Class: Geocoder::Lookup::MaxmindGeoip2
- Defined in:
- lib/geocoder/lookups/maxmind_geoip2.rb
Instance Method Summary collapse
- #name ⇒ Object
- #query_url(query) ⇒ Object
-
#supported_protocols ⇒ Object
Maxmind’s GeoIP2 Precision Services only supports HTTPS, otherwise a ‘404 Not Found` HTTP response will be returned.
Methods inherited from Base
#cache, #handle, #initialize, #map_link_url, #required_api_key_parts, #search
Constructor Details
This class inherits a constructor from Geocoder::Lookup::Base
Instance Method Details
#name ⇒ Object
7 8 9 |
# File 'lib/geocoder/lookups/maxmind_geoip2.rb', line 7 def name "MaxMind GeoIP2" end |
#query_url(query) ⇒ Object
17 18 19 |
# File 'lib/geocoder/lookups/maxmind_geoip2.rb', line 17 def query_url(query) "#{protocol}://geoip.maxmind.com/geoip/v2.1/#{configured_service!}/#{URI.escape(query.sanitized_text.strip)}" end |
#supported_protocols ⇒ Object
Maxmind’s GeoIP2 Precision Services only supports HTTPS, otherwise a ‘404 Not Found` HTTP response will be returned
13 14 15 |
# File 'lib/geocoder/lookups/maxmind_geoip2.rb', line 13 def supported_protocols [:https] end |