Class: Geocoder::Lookup::PostcodesIo

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/lookups/postcodes_io.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


6
7
8
# File 'lib/geocoder/lookups/postcodes_io.rb', line 6

def name
  'Postcodes.io'
end

#query_url(query) ⇒ Object


10
11
12
# File 'lib/geocoder/lookups/postcodes_io.rb', line 10

def query_url(query)
  "#{protocol}://api.postcodes.io/postcodes/#{query.sanitized_text.gsub(/\s/, '')}"
end

#supported_protocolsObject


14
15
16
# File 'lib/geocoder/lookups/postcodes_io.rb', line 14

def supported_protocols
  [:https]
end