Class: Author

Inherits:
Object
  • Object
show all
Defined in:
lib/quote_box/author.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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,rating=nil)
		@name=name
		@dob= dob
		
		
		
		@bio=bio
		@rating=rating
end

Instance Attribute Details

#bioObject

Returns the value of attribute bio.



2
3
4
# File 'lib/quote_box/author.rb', line 2

def bio
  @bio
end

#dobObject

Returns the value of attribute dob.



2
3
4
# File 'lib/quote_box/author.rb', line 2

def dob
  @dob
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/quote_box/author.rb', line 2

def name
  @name
end

#ratingObject

Returns the value of attribute rating.



2
3
4
# File 'lib/quote_box/author.rb', line 2

def rating
  @rating
end

Class Method Details



16
17
18
19
# File 'lib/quote_box/author.rb', line 16

def self.create_by_link(link)
	Scrapper.scrape_author(link)
	
end

Instance Method Details

#displayObject



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.rating}"
	
end