Module: GeoDistance::Unit

Extended by:
GeoUnits, GeoUnits::UnitMaps
Included in:
Fixnum, Float
Defined in:
lib/geo_vectors/util/geo_distance/units.rb

Overview

used to extend Fixnum and Float

Instance Method Summary collapse

Methods included from GeoUnits::Methods

#check_unit!, #default_unit, #default_unit=, #valid_unit?, #valid_units

Methods included from GeoUnits::UnitMaps

earth_radius, meters_map

Instance Method Details

#[](key) ⇒ Object

Raises:

  • (ArgumentError)


24
25
26
27
# File 'lib/geo_vectors/util/geo_distance/units.rb', line 24

def [] key
  raise ArgumentError, "Invalid unit key #{key}" if !respond_to? key
  earth_radius[key] * self
end