Class: Libri::Book
- Inherits:
-
Object
- Object
- Libri::Book
- Defined in:
- lib/libri/book.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#about_author ⇒ Object
Returns the value of attribute about_author.
-
#availability ⇒ Object
Returns the value of attribute availability.
-
#blurbs_and_plot ⇒ Object
Returns the value of attribute blurbs_and_plot.
-
#book ⇒ Object
Returns the value of attribute book.
-
#excerpt ⇒ Object
Returns the value of attribute excerpt.
-
#title_by_author ⇒ Object
Returns the value of attribute title_by_author.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(book_info_hash) ⇒ Book
constructor
A new instance of Book.
Constructor Details
#initialize(book_info_hash) ⇒ Book
Returns a new instance of Book.
6 7 8 9 10 11 |
# File 'lib/libri/book.rb', line 6 def initialize(book_info_hash) book_info_hash.map { |key, val| send "#{key}=", val } @@all << self end |
Instance Attribute Details
#about_author ⇒ Object
Returns the value of attribute about_author.
2 3 4 |
# File 'lib/libri/book.rb', line 2 def @about_author end |
#availability ⇒ Object
Returns the value of attribute availability.
2 3 4 |
# File 'lib/libri/book.rb', line 2 def availability @availability end |
#blurbs_and_plot ⇒ Object
Returns the value of attribute blurbs_and_plot.
2 3 4 |
# File 'lib/libri/book.rb', line 2 def blurbs_and_plot @blurbs_and_plot end |
#book ⇒ Object
Returns the value of attribute book.
2 3 4 |
# File 'lib/libri/book.rb', line 2 def book @book end |
#excerpt ⇒ Object
Returns the value of attribute excerpt.
2 3 4 |
# File 'lib/libri/book.rb', line 2 def excerpt @excerpt end |
#title_by_author ⇒ Object
Returns the value of attribute title_by_author.
2 3 4 |
# File 'lib/libri/book.rb', line 2 def @title_by_author end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/libri/book.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/libri/book.rb', line 17 def self.all @@all end |
.create_from_collection(book_info_hash) ⇒ Object
13 14 15 |
# File 'lib/libri/book.rb', line 13 def self.create_from_collection(book_info_hash) self.new(book_info_hash) end |