Class: Geocoder::Result::Pelias
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Pelias
show all
- Defined in:
- lib/geocoder/results/pelias.rb
Instance Attribute Summary
Attributes inherited from Base
#cache_hit, #data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#country, #initialize, #latitude, #longitude, #province_code
Class Method Details
.response_attributes ⇒ Object
37
38
39
|
# File 'lib/geocoder/results/pelias.rb', line 37
def self.response_attributes
%w[county confidence country gid id layer localadmin locality neighborhood]
end
|
Instance Method Details
#address(format = :full) ⇒ Object
5
6
7
|
# File 'lib/geocoder/results/pelias.rb', line 5
def address(format = :full)
properties['label']
end
|
#city ⇒ Object
9
10
11
|
# File 'lib/geocoder/results/pelias.rb', line 9
def city
locality
end
|
#coordinates ⇒ Object
13
14
15
|
# File 'lib/geocoder/results/pelias.rb', line 13
def coordinates
geometry['coordinates'].reverse
end
|
#country_code ⇒ Object
17
18
19
|
# File 'lib/geocoder/results/pelias.rb', line 17
def country_code
properties['country_a']
end
|
#postal_code ⇒ Object
21
22
23
|
# File 'lib/geocoder/results/pelias.rb', line 21
def postal_code
properties['postalcode'].to_s
end
|
#province ⇒ Object
25
26
27
|
# File 'lib/geocoder/results/pelias.rb', line 25
def province
state
end
|
#state ⇒ Object
29
30
31
|
# File 'lib/geocoder/results/pelias.rb', line 29
def state
properties['region']
end
|
#state_code ⇒ Object
33
34
35
|
# File 'lib/geocoder/results/pelias.rb', line 33
def state_code
properties['region_a']
end
|