lib/geocoder/lookups/ipstack.rb in geocoder-1.4.9 vs lib/geocoder/lookups/ipstack.rb in geocoder-1.5.0
- old
+ new
@@ -19,18 +19,21 @@
def name
"Ipstack"
end
- def query_url(query)
- extra_params = url_query_string(query)
- url = "#{protocol}://#{host}/#{query.sanitized_text}?access_key=#{api_key}"
- url << "&#{extra_params}" unless extra_params.empty?
- url
+ private # ----------------------------------------------------------------
+
+ def base_query_url(query)
+ "#{protocol}://#{host}/#{query.sanitized_text}?"
end
- private
+ def query_url_params(query)
+ {
+ access_key: configuration.api_key
+ }.merge(super)
+ end
def results(query)
# don't look up a loopback address, just return the stored result
return [reserved_result(query.text)] if query.loopback_ip_address?
@@ -53,12 +56,8 @@
}
end
def host
configuration[:host] || "api.ipstack.com"
- end
-
- def api_key
- configuration.api_key
end
end
end