Class: GeoMagic::Point
Instance Attribute Summary
Attributes inherited from MapPoint
#dist, #latitude, #longitude
Instance Method Summary
collapse
Methods inherited from MapPoint
#move_distance, #move_within, #within
Constructor Details
#initialize(latitude, longitude) ⇒ Point
Returns a new instance of Point.
6
7
8
|
# File 'lib/geo_magic/point.rb', line 6
def initialize latitude, longitude
super
end
|
Instance Method Details
#to_hash(mode = :long) ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'lib/geo_magic/point.rb', line 10
def to_hash mode= :long
case mode
when :short
{:lat => latitude, :long => longitude}
else
{:latitude => latitude, :longitude => longitude}
end
end
|
#to_location ⇒ Object
19
20
21
|
# File 'lib/geo_magic/point.rb', line 19
def to_location
raise "TODO: Use geocoder!"
end
|
#to_s ⇒ Object
23
24
25
|
# File 'lib/geo_magic/point.rb', line 23
def to_s
"(lat: #{latitude}, long: #{longitude}, dist: #{dist})"
end
|