Class: Google::Books::Item
- Inherits:
-
Object
- Object
- Google::Books::Item
- Defined in:
- lib/bookle/google_books_item.rb
Instance Attribute Summary collapse
-
#access_info ⇒ Object
readonly
Returns the value of attribute access_info.
-
#etag ⇒ Object
readonly
Returns the value of attribute etag.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#sale_info ⇒ Object
readonly
Returns the value of attribute sale_info.
-
#search_info ⇒ Object
readonly
Returns the value of attribute search_info.
-
#self_link ⇒ Object
readonly
Returns the value of attribute self_link.
-
#volume_info ⇒ Object
readonly
Returns the value of attribute volume_info.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(item) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(item) ⇒ Item
Returns a new instance of Item.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bookle/google_books_item.rb', line 12 def initialize(item) item = {} unless item @kind = item["kind"] @id = item["id"] @etag = item["etag"] @self_link = item["selfLink"] @volume_info = Google::Books::VolumeInfo.new(item["volumeInfo"]) @sale_info = Google::Books::SaleInfo.new(item["saleInfo"]) @access_info = Google::Books::AccessInfo.new(item["accessInfo"]) @search_info = Google::Books::SearchInfo.new(item["searchInfo"]) end |
Instance Attribute Details
#access_info ⇒ Object (readonly)
Returns the value of attribute access_info.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def access_info @access_info end |
#etag ⇒ Object (readonly)
Returns the value of attribute etag.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def etag @etag end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def kind @kind end |
#sale_info ⇒ Object (readonly)
Returns the value of attribute sale_info.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def sale_info @sale_info end |
#search_info ⇒ Object (readonly)
Returns the value of attribute search_info.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def search_info @search_info end |
#self_link ⇒ Object (readonly)
Returns the value of attribute self_link.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def self_link @self_link end |
#volume_info ⇒ Object (readonly)
Returns the value of attribute volume_info.
10 11 12 |
# File 'lib/bookle/google_books_item.rb', line 10 def volume_info @volume_info end |
Instance Method Details
#hash ⇒ Object
24 25 26 |
# File 'lib/bookle/google_books_item.rb', line 24 def hash Hasherizer.to_hash(self) end |