Class: Geocoder::Lookup::MaxmindGeoip2

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/lookups/maxmind_geoip2.rb

Instance Method Summary collapse

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

#nameObject



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_protocolsObject

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