Class: Drifter::Geocoders::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/drifter/geocoders/base.rb

Overview

nodoc

Direct Known Subclasses

Google, HostIP, Yahoo

Constant Summary collapse

@@last_error =

used by geocode()

nil

Class Method Summary collapse

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_errorObject

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(options={})
  raise "Not implemented"
end