Class: Geocoder::Result::PostcodeAnywhereUk
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::PostcodeAnywhereUk
show all
- Defined in:
- lib/geocoder/results/postcode_anywhere_uk.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
#address ⇒ Object
17
18
19
|
# File 'lib/geocoder/results/postcode_anywhere_uk.rb', line 17
def address
@data['Location']
end
|
#blank_result ⇒ Object
Also known as:
state, state_code, postal_code
10
11
12
|
# File 'lib/geocoder/results/postcode_anywhere_uk.rb', line 10
def blank_result
''
end
|
#city ⇒ Object
21
22
23
24
25
26
|
# File 'lib/geocoder/results/postcode_anywhere_uk.rb', line 21
def city
city = @data['Location'].split(',')[-2] || blank_result
city.strip
end
|
#coordinates ⇒ Object
6
7
8
|
# File 'lib/geocoder/results/postcode_anywhere_uk.rb', line 6
def coordinates
[@data['Latitude'].to_f, @data['Longitude'].to_f]
end
|
#country ⇒ Object
This is a UK only API; all results are UK specific and so ommitted from API response.
34
35
36
|
# File 'lib/geocoder/results/postcode_anywhere_uk.rb', line 34
def country
'United Kingdom'
end
|
#country_code ⇒ Object
38
39
40
|
# File 'lib/geocoder/results/postcode_anywhere_uk.rb', line 38
def country_code
'UK'
end
|
#os_grid ⇒ Object
28
29
30
|
# File 'lib/geocoder/results/postcode_anywhere_uk.rb', line 28
def os_grid
@data['OsGrid']
end
|