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
Instance Method Details
#address ⇒ Object
47
48
49
|
# File 'lib/geocoder/results/mapquest.rb', line 47
def address
[street, city, state, postal_code, country].reject{|s| s.length == 0 }.join(", ")
end
|
#city ⇒ Object
17
18
19
|
# File 'lib/geocoder/results/mapquest.rb', line 17
def city
@data['adminArea5']
end
|
#coordinates ⇒ Object
13
14
15
|
# File 'lib/geocoder/results/mapquest.rb', line 13
def coordinates
[latitude, longitude]
end
|
#country ⇒ Object
39
40
41
|
# File 'lib/geocoder/results/mapquest.rb', line 39
def country
@data['adminArea1']
end
|
#country_code ⇒ Object
43
44
45
|
# File 'lib/geocoder/results/mapquest.rb', line 43
def country_code
country
end
|
#latitude ⇒ Object
5
6
7
|
# File 'lib/geocoder/results/mapquest.rb', line 5
def latitude
@data["latLng"]["lat"]
end
|
#longitude ⇒ Object
9
10
11
|
# File 'lib/geocoder/results/mapquest.rb', line 9
def longitude
@data["latLng"]["lng"]
end
|
#postal_code ⇒ Object
35
36
37
|
# File 'lib/geocoder/results/mapquest.rb', line 35
def postal_code
@data['postalCode'].to_s
end
|
#state ⇒ Object
Also known as:
state_code, province, province_code
25
26
27
|
# File 'lib/geocoder/results/mapquest.rb', line 25
def state
@data['adminArea3']
end
|
#street ⇒ Object
21
22
23
|
# File 'lib/geocoder/results/mapquest.rb', line 21
def street
@data['street']
end
|