Class: Suitcase::Image
- Inherits:
-
Object
- Object
- Suitcase::Image
- Defined in:
- lib/suitcase/hotel/image.rb
Instance Attribute Summary collapse
-
#caption ⇒ Object
Returns the value of attribute caption.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
-
#url ⇒ Object
Returns the value of attribute url.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(data) ⇒ Image
constructor
A new instance of Image.
- #size ⇒ Object
Constructor Details
#initialize(data) ⇒ Image
Returns a new instance of Image.
5 6 7 8 9 10 11 12 13 |
# File 'lib/suitcase/hotel/image.rb', line 5 def initialize(data) @id = data["hotelImageId"] @name = data["name"] @caption = data["caption"] @url = data["url"] @thumbnail_url = data["thumbnailURL"] @width = data["width"] @height = data["height"] end |
Instance Attribute Details
#caption ⇒ Object
Returns the value of attribute caption.
3 4 5 |
# File 'lib/suitcase/hotel/image.rb', line 3 def @caption end |
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/suitcase/hotel/image.rb', line 3 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/suitcase/hotel/image.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/suitcase/hotel/image.rb', line 3 def name @name end |
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
3 4 5 |
# File 'lib/suitcase/hotel/image.rb', line 3 def thumbnail_url @thumbnail_url end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/suitcase/hotel/image.rb', line 3 def url @url end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/suitcase/hotel/image.rb', line 3 def width @width end |
Instance Method Details
#size ⇒ Object
15 16 17 |
# File 'lib/suitcase/hotel/image.rb', line 15 def size width.to_s + "x" + height.to_s end |