Newer
Older
require "geocoder/configuration"
module Geocoder
extend self
##
lookup.search(*args)
end
##
# Get the lookup object (which communicates with the remote geocoding API).
#
def lookup
unless defined?(@lookup)
set_lookup Geocoder::Configuration.lookup
end
@lookup
end
def set_lookup(value)
if value == :yahoo
require "geocoder/lookups/yahoo"
@lookup = Geocoder::Lookup::Yahoo.new
else
require "geocoder/lookups/google"
@lookup = Geocoder::Lookup::Google.new
end
# exception classes
class Error < StandardError; end
class ConfigurationError < Error; end