Class: BookWorm::Book
- Inherits:
-
Object
- Object
- BookWorm::Book
- Defined in:
- lib/book_worm/book.rb
Overview
Book
Book is used to store the xml data that is returned from ISBNDB
Instance Attribute Summary collapse
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#average_price ⇒ Object
Returns the value of attribute average_price.
-
#book_id ⇒ Object
Returns the value of attribute book_id.
-
#isbn ⇒ Object
Returns the value of attribute isbn.
-
#isbn13 ⇒ Object
Returns the value of attribute isbn13.
-
#long_title ⇒ Object
Returns the value of attribute long_title.
-
#publisher ⇒ Object
Returns the value of attribute publisher.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(book_data) ⇒ Book
constructor
A new instance of Book.
Constructor Details
#initialize(book_data) ⇒ Book
Returns a new instance of Book.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/book_worm/book.rb', line 11 def initialize(book_data) self.long_title = book_data["TitleLong"] self.publisher = book_data["PublisherText"] self. = book_data["AuthorsText"].chop.chop self.isbn = book_data["isbn"] self.isbn13 = book_data["isbn13"] self.title = book_data["Title"] self.book_id = book_data["book_id"] self.average_price = average_price_listed(book_data["Prices"]['Price']) end |
Instance Attribute Details
#authors ⇒ Object
Returns the value of attribute authors.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def @authors end |
#average_price ⇒ Object
Returns the value of attribute average_price.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def average_price @average_price end |
#book_id ⇒ Object
Returns the value of attribute book_id.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def book_id @book_id end |
#isbn ⇒ Object
Returns the value of attribute isbn.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def isbn @isbn end |
#isbn13 ⇒ Object
Returns the value of attribute isbn13.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def isbn13 @isbn13 end |
#long_title ⇒ Object
Returns the value of attribute long_title.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def long_title @long_title end |
#publisher ⇒ Object
Returns the value of attribute publisher.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def publisher @publisher end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/book_worm/book.rb', line 7 def title @title end |