Class: Drifter::Geocoders::Base
- Inherits:
-
Object
- Object
- Drifter::Geocoders::Base
- Defined in:
- lib/drifter/geocoders/base.rb
Overview
nodoc
Constant Summary collapse
- @@last_error =
used by geocode()
nil
Class Method Summary collapse
-
.geocode(*args) ⇒ Object
takes a location parameter and returns an Array of Drifter::Location objects with the results of the geocoding request.
-
.last_error ⇒ Object
Returns a Hash containing error information from the last geocoding request or nil if there was no error.
-
.query_uri(options = {}) ⇒ Object
Returns a URI object used to make the call to the geocoding service.
Class Method Details
.geocode(*args) ⇒ Object
takes a location parameter and returns an Array of Drifter::Location objects with the results of the geocoding request. If the geocoder returns an error, this method should store the error in @@last_error and return nil.
18 19 20 |
# File 'lib/drifter/geocoders/base.rb', line 18 def self.geocode(*args) raise "Not implemented" end |
.last_error ⇒ Object
Returns a Hash containing error information from the last geocoding request or nil if there was no error. Subclasses should set @@last_error to nil after every successful request
26 27 28 |
# File 'lib/drifter/geocoders/base.rb', line 26 def self.last_error @@last_error end |
.query_uri(options = {}) ⇒ Object
Returns a URI object used to make the call to the geocoding service. Subclasses should implement checks for required parameters. See geocoder/yahoo.rb for an example
34 35 36 |
# File 'lib/drifter/geocoders/base.rb', line 34 def self.query_uri(={}) raise "Not implemented" end |