Class: Google::Search::Item::Book
- Inherits:
-
Google::Search::Item
- Object
- Google::Search::Item
- Google::Search::Item::Book
- Defined in:
- lib/google-search/item/book.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Author name(s).
-
#id ⇒ Object
readonly
Book id.
-
#pages ⇒ Object
readonly
Page count.
-
#published_year ⇒ Object
readonly
Published year.
Attributes inherited from Google::Search::Item
#content, #index, #thumbnail_height, #thumbnail_uri, #thumbnail_width, #title, #uri, #visible_uri
Instance Method Summary collapse
-
#initialize(hash) ⇒ Book
constructor
Initialize with hash.
Methods inherited from Google::Search::Item
Constructor Details
#initialize(hash) ⇒ Book
Initialize with hash.
30 31 32 33 34 35 36 |
# File 'lib/google-search/item/book.rb', line 30 def initialize hash super @author = hash['authors'] @published_year = hash['publishedYear'].to_i @id = hash['bookId'] @pages = hash['pageCount'].to_i end |
Instance Attribute Details
#author ⇒ Object (readonly)
Author name(s).
15 16 17 |
# File 'lib/google-search/item/book.rb', line 15 def @author end |
#id ⇒ Object (readonly)
Book id.
10 11 12 |
# File 'lib/google-search/item/book.rb', line 10 def id @id end |
#pages ⇒ Object (readonly)
Page count.
25 26 27 |
# File 'lib/google-search/item/book.rb', line 25 def pages @pages end |
#published_year ⇒ Object (readonly)
Published year.
20 21 22 |
# File 'lib/google-search/item/book.rb', line 20 def published_year @published_year end |