Class: GeoMagic::GeoAdapter
- Inherits:
-
Object
- Object
- GeoMagic::GeoAdapter
- Defined in:
- lib/geo_magic/geocode/geocoder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#service_name ⇒ Object
Returns the value of attribute service_name.
Instance Method Summary collapse
-
#initialize(service_name = :google, env = :default) ⇒ GeoAdapter
constructor
A new instance of GeoAdapter.
- #setup(env) ⇒ Object
Constructor Details
#initialize(service_name = :google, env = :default) ⇒ GeoAdapter
Returns a new instance of GeoAdapter.
10 11 12 13 14 |
# File 'lib/geo_magic/geocode/geocoder.rb', line 10 def initialize service_name = :google, env = :default setup(env) @service_name = service_name @environment = env end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
8 9 10 |
# File 'lib/geo_magic/geocode/geocoder.rb', line 8 def environment @environment end |
#service_name ⇒ Object
Returns the value of attribute service_name.
8 9 10 |
# File 'lib/geo_magic/geocode/geocoder.rb', line 8 def service_name @service_name end |
Instance Method Details
#setup(env) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/geo_magic/geocode/geocoder.rb', line 16 def setup env case env when :rails require 'rails/config' self.class.send(:include, RailsServiceAdapter) else self.class.send(:include, ServiceAdapter) end end |