class Geocoder::Result::UkOrdnanceSurveyNames

def city

def city
  is_postcode? ? data['DISTRICT_BOROUGH'] : data['NAME1']
end

def code_from_uri(uri)

def code_from_uri(uri)
  return '' if uri.nil?
  uri.split('/').last
end

def coordinates

def coordinates
  @coordinates ||= Geocoder::EastingNorthing.new(
    easting: data['GEOMETRY_X'],
    northing: data['GEOMETRY_Y'],
  ).lat_lng
end

def country

def country
  'United Kingdom'
end

def country_code

def country_code
  'UK'
end

def county

def county
  data['COUNTY_UNITARY']
end

def county_code

def county_code
  code_from_uri data['COUNTY_UNITARY_URI']
end

def is_postcode?

def is_postcode?
  data['LOCAL_TYPE'] == 'Postcode'
end

def postal_code

def postal_code
  is_postcode? ? data['NAME1'] : ''
end

def province

def province
  data['REGION']
end

def province_code

def province_code
  code_from_uri data['REGION_URI']
end