Class: Geocoder::Result::PostcodesIo
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::PostcodesIo
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
Instance Method Details
#city ⇒ Object
19
20
21
|
# File 'lib/geocoder/results/postcodes_io.rb', line 19
def city
@data['admin_ward']
end
|
#coordinates ⇒ Object
6
7
8
|
# File 'lib/geocoder/results/postcodes_io.rb', line 6
def coordinates
[@data['latitude'].to_f, @data['longitude'].to_f]
end
|
#country ⇒ Object
32
33
34
|
# File 'lib/geocoder/results/postcodes_io.rb', line 32
def country
'United Kingdom'
end
|
#country_code ⇒ Object
36
37
38
|
# File 'lib/geocoder/results/postcodes_io.rb', line 36
def country_code
'UK'
end
|
#county ⇒ Object
Also known as:
state
23
24
25
|
# File 'lib/geocoder/results/postcodes_io.rb', line 23
def county
@data['admin_county']
end
|
#postal_code ⇒ Object
Also known as:
address
14
15
16
|
# File 'lib/geocoder/results/postcodes_io.rb', line 14
def postal_code
@data['postcode']
end
|
#quality ⇒ Object
10
11
12
|
# File 'lib/geocoder/results/postcodes_io.rb', line 10
def quality
@data['quality']
end
|
#state_code ⇒ Object
28
29
30
|
# File 'lib/geocoder/results/postcodes_io.rb', line 28
def state_code
@data['codes']['admin_county']
end
|