Class: Geocoder::Lookup::IpdataCo

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/lookups/ipdata_co.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/ipdata_co.rb', line 7

def name
  "ipdata.co"
end

#query_url(query) ⇒ Object


15
16
17
18
19
# File 'lib/geocoder/lookups/ipdata_co.rb', line 15

def query_url(query)
  # Ipdata.co requires that the API key be sent as a query parameter.
  # It no longer supports API keys sent as headers.
  "#{protocol}://#{host}/#{query.sanitized_text}?api-key=#{configuration.api_key}"
end

#supported_protocolsObject


11
12
13
# File 'lib/geocoder/lookups/ipdata_co.rb', line 11

def supported_protocols
  [:https]
end