Class: GeoMagic::Point

Inherits:
MapPoint show all
Defined in:
lib/geo_magic/point.rb

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_locationObject



19
20
21
# File 'lib/geo_magic/point.rb', line 19

def to_location
  raise "TODO: Use geocoder!"
end

#to_sObject



23
24
25
# File 'lib/geo_magic/point.rb', line 23

def to_s   
  "(lat: #{latitude}, long: #{longitude}, dist: #{dist})"
end