Class: Google::Books::SaleInfo
- Inherits:
-
Object
- Object
- Google::Books::SaleInfo
- Defined in:
- lib/bookle/google_books_sale_info.rb
Instance Attribute Summary collapse
-
#buy_link ⇒ Object
readonly
Returns the value of attribute buy_link.
-
#is_ebook ⇒ Object
readonly
Returns the value of attribute is_ebook.
-
#list_price ⇒ Object
readonly
Returns the value of attribute list_price.
-
#retail_price ⇒ Object
readonly
Returns the value of attribute retail_price.
-
#sale_country ⇒ Object
readonly
Returns the value of attribute sale_country.
-
#saleability ⇒ Object
readonly
Returns the value of attribute saleability.
Instance Method Summary collapse
-
#initialize(sale_info) ⇒ SaleInfo
constructor
A new instance of SaleInfo.
Constructor Details
#initialize(sale_info) ⇒ SaleInfo
Returns a new instance of SaleInfo.
9 10 11 12 13 14 15 16 17 |
# File 'lib/bookle/google_books_sale_info.rb', line 9 def initialize(sale_info) sale_info = {} unless sale_info @sale_country = sale_info["country"] @saleability = sale_info["saleability"] @is_ebook = sale_info["isEbook"] @list_price = Google::Books::ListPrice.new(sale_info["listPrice"]) @retail_price = Google::Books::RetailPrice.new(sale_info["retailPrice"]) @buy_link = sale_info["buyLink"] end |
Instance Attribute Details
#buy_link ⇒ Object (readonly)
Returns the value of attribute buy_link.
7 8 9 |
# File 'lib/bookle/google_books_sale_info.rb', line 7 def buy_link @buy_link end |
#is_ebook ⇒ Object (readonly)
Returns the value of attribute is_ebook.
7 8 9 |
# File 'lib/bookle/google_books_sale_info.rb', line 7 def is_ebook @is_ebook end |
#list_price ⇒ Object (readonly)
Returns the value of attribute list_price.
7 8 9 |
# File 'lib/bookle/google_books_sale_info.rb', line 7 def list_price @list_price end |
#retail_price ⇒ Object (readonly)
Returns the value of attribute retail_price.
7 8 9 |
# File 'lib/bookle/google_books_sale_info.rb', line 7 def retail_price @retail_price end |
#sale_country ⇒ Object (readonly)
Returns the value of attribute sale_country.
7 8 9 |
# File 'lib/bookle/google_books_sale_info.rb', line 7 def sale_country @sale_country end |
#saleability ⇒ Object (readonly)
Returns the value of attribute saleability.
7 8 9 |
# File 'lib/bookle/google_books_sale_info.rb', line 7 def saleability @saleability end |