Class: Rapa::Quantity

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Quantity

Returns a new instance of Quantity.

Parameters:

  • source (Hash)


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

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceHash (readonly)

Returns:

  • (Hash)


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

def source
  @source
end

Instance Method Details

#unitsString

Returns:

  • (String)


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

def units
  source["Units"]
end

#valueInteger

Returns:

  • (Integer)


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

def value
  source["__content__"].to_i
end