Class: EarthTools::Result::Height

Inherits:
Base
  • Object
show all
Defined in:
lib/earth_tools/result/height.rb

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Base

#initialize, #latitude, #location, #longitude, #version

Constructor Details

This class inherits a constructor from EarthTools::Result::Base

Instance Method Details

#feetfloat

The height above sea level in feet See ).

Returns:

  • (float)

    the height above sea level in feet



34
35
36
# File 'lib/earth_tools/result/height.rb', line 34

def feet
  @data['feet'].to_f
end

#heightfloat

Returns height based on unit requested in configuration

Returns:

  • (float)


14
15
16
17
18
19
20
# File 'lib/earth_tools/result/height.rb', line 14

def height
  if EarthTools::Configuration.units == :metric
    meters
  else
    feet
  end
end

#metersfloat

The height above sea level in meters See http://en.wikipedia.org/wiki/Meter.

Returns:

  • (float)

    the height above sea level in meters



26
27
28
# File 'lib/earth_tools/result/height.rb', line 26

def meters
  @data['meters'].to_f
end