Class: Geocoder::Lookup::PostcodeAnywhereUk

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

Constant Summary collapse

BASE_URL_GEOCODE_V2_00 =
'services.postcodeanywhere.co.uk/Geocoding/UK/Geocode/v2.00/json.ws'
DAILY_LIMIT_EXEEDED_ERROR_CODES =

api docs say these two codes are the same error

['8', '17']
INVALID_API_KEY_ERROR_CODE =
'2'

Instance Method Summary collapse

Methods inherited from Base

#cache, #handle, #initialize, #map_link_url, #search

Constructor Details

This class inherits a constructor from Geocoder::Lookup::Base

Instance Method Details

#nameObject



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

def name
  'PostcodeAnywhereUk'
end

#query_url(query) ⇒ Object



19
20
21
# File 'lib/geocoder/lookups/postcode_anywhere_uk.rb', line 19

def query_url(query)
  format('%s://%s?%s', protocol, BASE_URL_GEOCODE_V2_00, url_query_string(query))
end

#required_api_key_partsObject



15
16
17
# File 'lib/geocoder/lookups/postcode_anywhere_uk.rb', line 15

def required_api_key_parts
  %w(key)
end