Class: EarthTools::Result::Height

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

Overview

The height result.

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



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

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

#heightfloat

Returns height based on unit requested in configuration

Returns:

  • (float)


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

#metersfloat

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

Returns:

  • (float)

    the height above sea level in meters



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

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