Class: Fassbinder::BookBuilder
- Inherits:
-
Object
- Object
- Fassbinder::BookBuilder
- Defined in:
- lib/fassbinder/book_builder.rb
Instance Attribute Summary collapse
-
#book ⇒ Object
readonly
Returns the value of attribute book.
Instance Method Summary collapse
- #add_offer(hash) ⇒ Object
- #asin=(asin) ⇒ Object
-
#initialize ⇒ BookBuilder
constructor
A new instance of BookBuilder.
- #offers_total=(count) ⇒ Object
- #venue=(venue) ⇒ Object
Constructor Details
#initialize ⇒ BookBuilder
Returns a new instance of BookBuilder.
8 9 10 11 |
# File 'lib/fassbinder/book_builder.rb', line 8 def initialize @book = Kosher::Book.new @book.offers = [] end |
Instance Attribute Details
#book ⇒ Object (readonly)
Returns the value of attribute book.
6 7 8 |
# File 'lib/fassbinder/book_builder.rb', line 6 def book @book end |
Instance Method Details
#add_offer(hash) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/fassbinder/book_builder.rb', line 13 def add_offer(hash) builder = OfferBuilder.new builder.id = hash['OfferListing']['OfferListingId'] builder.venue = @book.venue builder.add_item(hash) builder.add_seller(hash['Merchant']) builder.add_shipping(hash) @book.offers << builder.offer end |
#asin=(asin) ⇒ Object
23 24 25 |
# File 'lib/fassbinder/book_builder.rb', line 23 def asin=(asin) @book.asin = asin end |
#offers_total=(count) ⇒ Object
31 32 33 |
# File 'lib/fassbinder/book_builder.rb', line 31 def offers_total=(count) @book.offers_total = count.to_i end |
#venue=(venue) ⇒ Object
27 28 29 |
# File 'lib/fassbinder/book_builder.rb', line 27 def venue=(venue) @book.venue = venue end |