Class: GeoMagic::GraticuleAdapter
Instance Attribute Summary
Attributes inherited from GeoAdapter
#environment, #service_name
Instance Method Summary
collapse
Methods inherited from GeoAdapter
#get_key, #get_service, #setup
Constructor Details
#initialize(services = :google, env = :default) ⇒ GraticuleAdapter
Returns a new instance of GraticuleAdapter.
5
6
7
|
# File 'lib/geo_magic/geocode/graticule_adapter.rb', line 5
def initialize services = :google, env = :default
super
end
|
Instance Method Details
#create_graticule_service(key_name = nil) ⇒ Object
14
15
16
17
|
# File 'lib/geo_magic/geocode/graticule_adapter.rb', line 14
def create_graticule_service key_name = nil
api_key = get_key(key_name || service_name)
gs_service.new api_key
end
|
#geocode(location_str) ⇒ Object
19
20
21
|
# File 'lib/geo_magic/geocode/graticule_adapter.rb', line 19
def geocode location_str
geo_coder.locate location_str
end
|
#gs_service ⇒ Object
23
24
25
|
# File 'lib/geo_magic/geocode/graticule_adapter.rb', line 23
def gs_service
::Graticule.service(service_name)
end
|
#instance ⇒ Object
9
10
11
12
|
# File 'lib/geo_magic/geocode/graticule_adapter.rb', line 9
def instance
@geo_coder ||= create_graticule_service
self
end
|