Class: Rapa::Quantity
- Inherits:
-
Object
- Object
- Rapa::Quantity
- Defined in:
- lib/rapa/quantity.rb
Instance Attribute Summary collapse
- #source ⇒ Hash readonly
Instance Method Summary collapse
-
#initialize(source) ⇒ Quantity
constructor
A new instance of Quantity.
- #units ⇒ String
- #value ⇒ Integer
Constructor Details
#initialize(source) ⇒ Quantity
Returns a new instance of Quantity.
7 8 9 |
# File 'lib/rapa/quantity.rb', line 7 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Hash (readonly)
4 5 6 |
# File 'lib/rapa/quantity.rb', line 4 def source @source end |
Instance Method Details
#units ⇒ String
12 13 14 |
# File 'lib/rapa/quantity.rb', line 12 def units source["Units"] end |
#value ⇒ Integer
17 18 19 |
# File 'lib/rapa/quantity.rb', line 17 def value source["__content__"].to_i end |