Class: Suitcase::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/suitcase/hotel/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#captionObject

Returns the value of attribute caption.



3
4
5
# File 'lib/suitcase/hotel/image.rb', line 3

def caption
  @caption
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/suitcase/hotel/image.rb', line 3

def height
  @height
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/suitcase/hotel/image.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/suitcase/hotel/image.rb', line 3

def name
  @name
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



3
4
5
# File 'lib/suitcase/hotel/image.rb', line 3

def thumbnail_url
  @thumbnail_url
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/suitcase/hotel/image.rb', line 3

def url
  @url
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/suitcase/hotel/image.rb', line 3

def width
  @width
end

Instance Method Details

#sizeObject



15
16
17
# File 'lib/suitcase/hotel/image.rb', line 15

def size
  width.to_s + "x" + height.to_s
end