Class: Stormglass::Subvalue
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Stormglass::Subvalue
- Defined in:
- lib/stormglass/subvalue.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(src) ⇒ Subvalue
constructor
A new instance of Subvalue.
- #src ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(src) ⇒ Subvalue
Returns a new instance of Subvalue.
3 4 5 6 |
# File 'lib/stormglass/subvalue.rb', line 3 def initialize(src) @src = src super end |
Instance Method Details
#description ⇒ Object
13 14 15 |
# File 'lib/stormglass/subvalue.rb', line 13 def description "#{@src[:description]} #{@src[:unit_description]}" end |
#src ⇒ Object
17 18 19 |
# File 'lib/stormglass/subvalue.rb', line 17 def src @src end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/stormglass/subvalue.rb', line 8 def to_s "#{@src[:value]} #{@src[:unit]}" end |