Class: EarthTools::Result::Height
- Defined in:
- lib/earth_tools/result/height.rb
Overview
The height result.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#feet ⇒ float
The height above sea level in feet See ).
-
#height ⇒ float
Returns height based on unit requested in configuration.
-
#meters ⇒ float
The height above sea level in meters See http://en.wikipedia.org/wiki/Meter.
Methods inherited from Base
#initialize, #latitude, #location, #longitude, #version
Constructor Details
This class inherits a constructor from EarthTools::Result::Base
Instance Method Details
#feet ⇒ float
The height above sea level in feet See ).
33 34 35 |
# File 'lib/earth_tools/result/height.rb', line 33 def feet @data['feet'].to_f end |
#height ⇒ float
Returns height based on unit requested in configuration
13 14 15 16 17 18 19 |
# File 'lib/earth_tools/result/height.rb', line 13 def height if EarthTools::Configuration.units == :metric meters else feet end end |
#meters ⇒ float
The height above sea level in meters See http://en.wikipedia.org/wiki/Meter.
25 26 27 |
# File 'lib/earth_tools/result/height.rb', line 25 def meters @data['meters'].to_f end |