Class: Stormglass::Subvalue

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/stormglass/subvalue.rb

Instance Method Summary collapse

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

#descriptionObject



13
14
15
# File 'lib/stormglass/subvalue.rb', line 13

def description
  "#{@src[:description]} #{@src[:unit_description]}"
end

#srcObject



17
18
19
# File 'lib/stormglass/subvalue.rb', line 17

def src
  @src
end

#to_sObject



8
9
10
# File 'lib/stormglass/subvalue.rb', line 8

def to_s
  "#{@src[:value]} #{@src[:unit]}"
end