Module: GeoMagic::ServiceAdapter
- Included in:
- RailsServiceAdapter
- Defined in:
- lib/geo_magic/geocode/config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#geo_coder ⇒ Object
readonly
Returns the value of attribute geo_coder.
Class Method Summary collapse
Instance Method Summary collapse
- #configure(path, env = :development) ⇒ Object
- #geocode(location_str) ⇒ Object
- #reverse_geocode(latitude, longitude) ⇒ Object
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/geo_magic/geocode/config.rb', line 3 def config @config end |
#geo_coder ⇒ Object (readonly)
Returns the value of attribute geo_coder.
3 4 5 |
# File 'lib/geo_magic/geocode/config.rb', line 3 def geo_coder @geo_coder end |
Class Method Details
.services_available ⇒ Object
18 19 20 |
# File 'lib/geo_magic/geocode/config.rb', line 18 def self.services_available [:google, :yahoo] end |
Instance Method Details
#configure(path, env = :development) ⇒ Object
13 14 15 16 |
# File 'lib/geo_magic/geocode/config.rb', line 13 def configure path, env = :development @config ||= ::YAML.load_file(path)[env.to_s] self end |
#geocode(location_str) ⇒ Object
5 6 7 |
# File 'lib/geo_magic/geocode/config.rb', line 5 def geocode location_str raise 'method #geocode must be implemented by adapter subclass' end |
#reverse_geocode(latitude, longitude) ⇒ Object
9 10 11 |
# File 'lib/geo_magic/geocode/config.rb', line 9 def reverse_geocode latitude, longitude raise 'method #reverse_geocode should be implemented by adapter subclass' end |