Class: Geocoder::Result::Mapquest
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Mapquest
show all
- Defined in:
- lib/geocoder/results/mapquest.rb
Instance Attribute Summary
Attributes inherited from Base
#cache_hit, #data
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #latitude, #longitude
Instance Method Details
#address ⇒ Object
44
45
46
|
# File 'lib/geocoder/results/mapquest.rb', line 44
def address
[street, city, state, postal_code, country].reject{|s| s.length == 0 }.join(", ")
end
|
#city ⇒ Object
10
11
12
|
# File 'lib/geocoder/results/mapquest.rb', line 10
def city
@data['adminArea5']
end
|
#coordinates ⇒ Object
6
7
8
|
# File 'lib/geocoder/results/mapquest.rb', line 6
def coordinates
%w[lat lng].map{ |l| @data["latLng"][l] }
end
|
#country ⇒ Object
36
37
38
|
# File 'lib/geocoder/results/mapquest.rb', line 36
def country
@data['adminArea1']
end
|
#country_code ⇒ Object
40
41
42
|
# File 'lib/geocoder/results/mapquest.rb', line 40
def country_code
country
end
|
#county ⇒ Object
22
23
24
|
# File 'lib/geocoder/results/mapquest.rb', line 22
def county
@data['adminArea4']
end
|
#postal_code ⇒ Object
32
33
34
|
# File 'lib/geocoder/results/mapquest.rb', line 32
def postal_code
@data['postalCode'].to_s
end
|
#state ⇒ Object
Also known as:
state_code, province, province_code
18
19
20
|
# File 'lib/geocoder/results/mapquest.rb', line 18
def state
@data['adminArea3']
end
|
#street ⇒ Object
14
15
16
|
# File 'lib/geocoder/results/mapquest.rb', line 14
def street
@data['street']
end
|