Class: Geocoder::Result::Esri
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Esri
show all
- Defined in:
- lib/geocoder/results/esri.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
6
7
8
9
|
# File 'lib/geocoder/results/esri.rb', line 6
def address
address = reverse_geocode? ? 'Address' : 'Match_addr'
attributes[address]
end
|
#city ⇒ Object
11
12
13
|
# File 'lib/geocoder/results/esri.rb', line 11
def city
attributes['City']
end
|
#coordinates ⇒ Object
32
33
34
|
# File 'lib/geocoder/results/esri.rb', line 32
def coordinates
[geometry["y"], geometry["x"]]
end
|
#country ⇒ Object
Also known as:
country_code
21
22
23
24
|
# File 'lib/geocoder/results/esri.rb', line 21
def country
country = reverse_geocode? ? "CountryCode" : "Country"
attributes[country]
end
|
#postal_code ⇒ Object
28
29
30
|
# File 'lib/geocoder/results/esri.rb', line 28
def postal_code
attributes['Postal']
end
|
#state_code ⇒ Object
Also known as:
state
15
16
17
|
# File 'lib/geocoder/results/esri.rb', line 15
def state_code
attributes['Region']
end
|