class Geocoder::Result::PostcodeAnywhereUk

Public Instance Methods

address() click to toggle source
# File lib/geocoder/results/postcode_anywhere_uk.rb, line 17
def address
  @data['Location']
end
blank_result() click to toggle source
# File lib/geocoder/results/postcode_anywhere_uk.rb, line 10
def blank_result
  ''
end
Also aliased as: state, state_code, postal_code
city() click to toggle source
# File lib/geocoder/results/postcode_anywhere_uk.rb, line 21
def city
  # is this too big a jump to assume that the API always
  # returns a City, County as the last elements?
  city = @data['Location'].split(',')[-2] || blank_result
  city.strip
end
coordinates() click to toggle source
# File lib/geocoder/results/postcode_anywhere_uk.rb, line 6
def coordinates
  [@data['Latitude'].to_f, @data['Longitude'].to_f]
end
country() click to toggle source

This is a UK only API; all results are UK specific and so ommitted from API response.

# File lib/geocoder/results/postcode_anywhere_uk.rb, line 34
def country
  'United Kingdom'
end
country_code() click to toggle source
# File lib/geocoder/results/postcode_anywhere_uk.rb, line 38
def country_code
  'UK'
end
os_grid() click to toggle source
# File lib/geocoder/results/postcode_anywhere_uk.rb, line 28
def os_grid
  @data['OsGrid']
end
postal_code()
Alias for: blank_result
state()
Alias for: blank_result
state_code()
Alias for: blank_result