Class: GoogleImages::Image
- Inherits:
-
Object
- Object
- GoogleImages::Image
- Defined in:
- lib/google_images/image.rb
Instance Attribute Summary collapse
-
#byte_size ⇒ Object
readonly
Returns the value of attribute byte_size.
-
#context_link ⇒ Object
readonly
Returns the value of attribute context_link.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#mime ⇒ Object
readonly
Returns the value of attribute mime.
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
-
#thumbnail_height ⇒ Object
readonly
Returns the value of attribute thumbnail_height.
-
#thumbnail_link ⇒ Object
readonly
Returns the value of attribute thumbnail_link.
-
#thumbnail_width ⇒ Object
readonly
Returns the value of attribute thumbnail_width.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(items_hash = {}) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(items_hash = {}) ⇒ Image
Returns a new instance of Image.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/google_images/image.rb', line 7 def initialize(items_hash = {}) @title = items_hash['title'] @link = items_hash['link'] @context_link = items_hash['image']['context_link'] @snippet = items_hash['snippet'] @mime = items_hash['mime'] @height = items_hash['image']['height'] @width = items_hash['image']['width'] @byte_size = items_hash['image']['byte_size'] @thumbnail_link = items_hash['image']['thumbnailLink'] @thumbnail_height = items_hash['image']['thumbnailHeight'] @thumbnail_width = items_hash['image']['thumbnailWidth'] end |
Instance Attribute Details
#byte_size ⇒ Object (readonly)
Returns the value of attribute byte_size.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def byte_size @byte_size end |
#context_link ⇒ Object (readonly)
Returns the value of attribute context_link.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def context_link @context_link end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def height @height end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def link @link end |
#mime ⇒ Object (readonly)
Returns the value of attribute mime.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def mime @mime end |
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def snippet @snippet end |
#thumbnail_height ⇒ Object (readonly)
Returns the value of attribute thumbnail_height.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def thumbnail_height @thumbnail_height end |
#thumbnail_link ⇒ Object (readonly)
Returns the value of attribute thumbnail_link.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def thumbnail_link @thumbnail_link end |
#thumbnail_width ⇒ Object (readonly)
Returns the value of attribute thumbnail_width.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def thumbnail_width @thumbnail_width end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def title @title end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'lib/google_images/image.rb', line 3 def width @width end |