class Geocoder::Lookup::PostcodesIo
def cache_key(query)
def cache_key(query) query_url(query) end
def name
def name 'Postcodes.io' end
def query_url(query)
def query_url(query) "#{protocol}://api.postcodes.io/postcodes/#{query.sanitized_text.gsub(/\s/, '')}" end
def results(query)
def results(query) response = fetch_data(query) return [] if response.nil? || response['status'] != 200 || response.empty? [response['result']] end
def supported_protocols
def supported_protocols [:https] end