Class: GeoSwap::UtmPoint
- Inherits:
-
Object
- Object
- GeoSwap::UtmPoint
- Defined in:
- lib/geo_swap/utm_point.rb
Instance Attribute Summary collapse
-
#easting ⇒ Object
readonly
Returns the value of attribute easting.
-
#hemisphere ⇒ Object
readonly
Returns the value of attribute hemisphere.
-
#northing ⇒ Object
readonly
Returns the value of attribute northing.
-
#zone ⇒ Object
readonly
Returns the value of attribute zone.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ UtmPoint
constructor
A new instance of UtmPoint.
- #to_s ⇒ Object
Constructor Details
#initialize(attrs) ⇒ UtmPoint
Returns a new instance of UtmPoint.
6 7 8 9 10 11 |
# File 'lib/geo_swap/utm_point.rb', line 6 def initialize(attrs) @easting = attrs.fetch(:easting) @northing = attrs.fetch(:northing) @zone = attrs.fetch(:zone) @hemisphere = attrs.fetch(:hemisphere) end |
Instance Attribute Details
#easting ⇒ Object (readonly)
Returns the value of attribute easting.
4 5 6 |
# File 'lib/geo_swap/utm_point.rb', line 4 def easting @easting end |
#hemisphere ⇒ Object (readonly)
Returns the value of attribute hemisphere.
4 5 6 |
# File 'lib/geo_swap/utm_point.rb', line 4 def hemisphere @hemisphere end |
#northing ⇒ Object (readonly)
Returns the value of attribute northing.
4 5 6 |
# File 'lib/geo_swap/utm_point.rb', line 4 def northing @northing end |
#zone ⇒ Object (readonly)
Returns the value of attribute zone.
4 5 6 |
# File 'lib/geo_swap/utm_point.rb', line 4 def zone @zone end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/geo_swap/utm_point.rb', line 13 def to_s "#{zone.number}#{zone.letter} #{easting}mE #{northing}mN" end |