Class: GeoMagic::GraticuleAdapter

Inherits:
GeoAdapter show all
Defined in:
lib/geo_magic/geocode/geocoder.rb

Instance Attribute Summary

Attributes inherited from GeoAdapter

#environment, #service_name

Instance Method Summary collapse

Methods inherited from GeoAdapter

#setup

Constructor Details

#initialize(service_name = :google, env = :default) ⇒ GraticuleAdapter

Returns a new instance of GraticuleAdapter.



28
29
30
# File 'lib/geo_magic/geocode/geocoder.rb', line 28

def initialize service_name = :google, env = :default
  super      
end

Instance Method Details

#geocode(location_str) ⇒ Object



37
38
39
# File 'lib/geo_magic/geocode/geocoder.rb', line 37

def geocode location_str
  geo_coder.locate location_str
end

#instanceObject



32
33
34
35
# File 'lib/geo_magic/geocode/geocoder.rb', line 32

def instance
  @geo_coder ||= ::Graticule.service(service_name).new google_key
  self
end