Class: Google::Search::Item::Image
- Inherits:
-
Google::Search::Item
- Object
- Google::Search::Item
- Google::Search::Item::Image
- Defined in:
- lib/google-search/item/image.rb
Instance Attribute Summary collapse
-
#context_uri ⇒ Object
readonly
Context uri.
-
#height ⇒ Object
readonly
Image height in pixels.
-
#id ⇒ Object
readonly
Image id.
-
#width ⇒ Object
readonly
Image width in pixels.
Attributes inherited from Google::Search::Item
#content, #index, #thumbnail_height, #thumbnail_uri, #thumbnail_width, #title, #uri, #visible_uri
Instance Method Summary collapse
-
#initialize(hash) ⇒ Image
constructor
Initialize with hash.
Methods inherited from Google::Search::Item
Constructor Details
#initialize(hash) ⇒ Image
Initialize with hash.
30 31 32 33 34 35 36 |
# File 'lib/google-search/item/image.rb', line 30 def initialize hash super @id = hash['imageId'] @context_uri = hash['originalContextUrl'] @width = hash['width'].to_i @height = hash['height'].to_i end |
Instance Attribute Details
#context_uri ⇒ Object (readonly)
Context uri.
15 16 17 |
# File 'lib/google-search/item/image.rb', line 15 def context_uri @context_uri end |
#height ⇒ Object (readonly)
Image height in pixels.
25 26 27 |
# File 'lib/google-search/item/image.rb', line 25 def height @height end |
#id ⇒ Object (readonly)
Image id.
10 11 12 |
# File 'lib/google-search/item/image.rb', line 10 def id @id end |
#width ⇒ Object (readonly)
Image width in pixels.
20 21 22 |
# File 'lib/google-search/item/image.rb', line 20 def width @width end |