lib/geocoder/lookups/base.rb in geocoder-1.1.6 vs lib/geocoder/lookups/base.rb in geocoder-1.1.7
- old
+ new
@@ -70,10 +70,20 @@
# URL to use for querying the geocoding engine.
#
def query_url(query)
fail
end
+
+ ##
+ # The working Cache object.
+ #
+ def cache
+ if @cache.nil? and store = configuration.cache
+ @cache = Cache.new(store, configuration.cache_prefix)
+ end
+ @cache
+ end
private # -------------------------------------------------------------
##
# An object with configuration data for this particular lookup.
@@ -221,19 +231,9 @@
parts_string = key_parts.size == 1 ? key_parts.first : key_parts
raise Geocoder::ConfigurationError,
"The #{query.lookup.name} API requires a key to be configured: " +
parts_string.inspect
end
- end
-
- ##
- # The working Cache object.
- #
- def cache
- if @cache.nil? and store = configuration.cache
- @cache = Cache.new(store, configuration.cache_prefix)
- end
- @cache
end
##
# Simulate ActiveSupport's Object#to_query.
# Removes any keys with nil value.