Class: Rapa::Image

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Image

Returns a new instance of Image.

Parameters:

  • source (Hash)


7
8
9
# File 'lib/rapa/image.rb', line 7

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceHash (readonly)

Returns:

  • (Hash)


4
5
6
# File 'lib/rapa/image.rb', line 4

def source
  @source
end

Instance Method Details

#heightInteger

Returns:

  • (Integer)


12
13
14
# File 'lib/rapa/image.rb', line 12

def height
  ::Rapa::Quantity.new(source["Height"])
end

#urlString

Returns:

  • (String)


17
18
19
# File 'lib/rapa/image.rb', line 17

def url
  source["URL"]
end

#widthInteger

Returns:

  • (Integer)


22
23
24
# File 'lib/rapa/image.rb', line 22

def width
  ::Rapa::Quantity.new(source["Width"])
end