Module: Silva::System::CoOrdinate

Included in:
Osgb36, Wgs84
Defined in:
lib/silva/system/co_ordinate.rb

Overview

Provides simple validations and accessors for a lat, long, alt co-ordinate system.

Constant Summary collapse

LAT_RANGE =

Allowed range of latitude

(-90..90)
LONG_RANGE =

Allowed range of longitude

(-180..180)
ALT_RANGE =

Allowed range of altitude

(-500..4000)
DEFAULT_PARAMS =

Default altitude = 0

{ :alt => 0 }
REQUIRED_PARAMS =
[:lat, :long]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#altObject (readonly)

Returns the value of attribute alt.



18
19
20
# File 'lib/silva/system/co_ordinate.rb', line 18

def alt
  @alt
end

#latObject (readonly)

Returns the value of attribute lat.



18
19
20
# File 'lib/silva/system/co_ordinate.rb', line 18

def lat
  @lat
end

#longObject (readonly)

Returns the value of attribute long.



18
19
20
# File 'lib/silva/system/co_ordinate.rb', line 18

def long
  @long
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/silva/system/co_ordinate.rb', line 20

def to_s
  [lat, long, alt].to_s
end