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
51
52
53
|
# File 'lib/geocoder/results/mapquest.rb', line 51
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
43
44
45
|
# File 'lib/geocoder/results/mapquest.rb', line 43
def country
@data['adminArea1']
end
|
#country_code ⇒ Object
47
48
49
|
# File 'lib/geocoder/results/mapquest.rb', line 47
def country_code
country
end
|
#county ⇒ Object
29
30
31
|
# File 'lib/geocoder/results/mapquest.rb', line 29
def county
@data['adminArea4']
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
39
40
41
|
# File 'lib/geocoder/results/mapquest.rb', line 39
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
|