Class: Author
- Inherits:
-
Object
- Object
- Author
- Defined in:
- lib/quote_box/author.rb
Instance Attribute Summary collapse
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#dob ⇒ Object
Returns the value of attribute dob.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rating ⇒ Object
Returns the value of attribute rating.
Class Method Summary collapse
Instance Method Summary collapse
- #display ⇒ Object
-
#initialize(name = nil, dob = nil, bio = nil, rating = nil) ⇒ Author
constructor
A new instance of Author.
Constructor Details
#initialize(name = nil, dob = nil, bio = nil, rating = nil) ⇒ Author
Returns a new instance of Author.
6 7 8 9 10 11 12 13 14 |
# File 'lib/quote_box/author.rb', line 6 def initialize(name=nil,dob=nil,bio=nil,=nil) @name=name @dob= dob @bio=bio @rating= end |
Instance Attribute Details
#bio ⇒ Object
Returns the value of attribute bio.
2 3 4 |
# File 'lib/quote_box/author.rb', line 2 def bio @bio end |
#dob ⇒ Object
Returns the value of attribute dob.
2 3 4 |
# File 'lib/quote_box/author.rb', line 2 def dob @dob end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/quote_box/author.rb', line 2 def name @name end |
#rating ⇒ Object
Returns the value of attribute rating.
2 3 4 |
# File 'lib/quote_box/author.rb', line 2 def @rating end |
Class Method Details
.create_by_link(link) ⇒ Object
16 17 18 19 |
# File 'lib/quote_box/author.rb', line 16 def self.create_by_link(link) Scrapper.(link) end |
Instance Method Details
#display ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/quote_box/author.rb', line 21 def display puts "Name: #{self.name}" puts "Born on: #{self.dob.strip}" puts "Bio: #{self.bio}" puts "Rating out of 5: #{self.}" end |