Class: Geocoder::Result::PostcodesIo

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/results/postcodes_io.rb

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Instance Method Summary collapse

Methods inherited from Base

#initialize, #latitude, #longitude, #province, #province_code

Constructor Details

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

Instance Method Details

#cityObject


19
20
21
# File 'lib/geocoder/results/postcodes_io.rb', line 19

def city
  @data['admin_ward']
end

#coordinatesObject


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

def coordinates
  [@data['latitude'].to_f, @data['longitude'].to_f]
end

#countryObject


32
33
34
# File 'lib/geocoder/results/postcodes_io.rb', line 32

def country
  'United Kingdom'
end

#country_codeObject


36
37
38
# File 'lib/geocoder/results/postcodes_io.rb', line 36

def country_code
  'UK'
end

#countyObject Also known as: state


23
24
25
# File 'lib/geocoder/results/postcodes_io.rb', line 23

def county
  @data['admin_county']
end

#postal_codeObject Also known as: address


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

def postal_code
  @data['postcode']
end

#qualityObject


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

def quality
  @data['quality']
end

#state_codeObject


28
29
30
# File 'lib/geocoder/results/postcodes_io.rb', line 28

def state_code
  @data['codes']['admin_county']
end