Class: Barometer::Data::Vector
Instance Attribute Summary collapse
Instance Method Summary
collapse
#<=>, #imperial, #initialize, #metric, #metric?
Instance Attribute Details
#bearing ⇒ Object
Returns the value of attribute bearing.
4
5
6
|
# File 'lib/barometer/data/vector.rb', line 4
def bearing
@bearing
end
|
Instance Method Details
#kph ⇒ Object
6
|
# File 'lib/barometer/data/vector.rb', line 6
def kph; metric; end
|
#mph ⇒ Object
7
|
# File 'lib/barometer/data/vector.rb', line 7
def mph; imperial; end
|
#nil? ⇒ Boolean
17
18
19
|
# File 'lib/barometer/data/vector.rb', line 17
def nil?
super && bearing.nil?
end
|
#to_s ⇒ Object
13
14
15
|
# File 'lib/barometer/data/vector.rb', line 13
def to_s
[super, bearing_to_s].compact.join(' @ ')
end
|
#units ⇒ Object
9
10
11
|
# File 'lib/barometer/data/vector.rb', line 9
def units
metric? ? 'kph' : 'mph'
end
|