Class: Geocoder::Result::Azure
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Azure
show all
- Defined in:
- lib/geocoder/results/azure.rb
Instance Attribute Summary
Attributes inherited from Base
#cache_hit, #data
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #latitude, #longitude, #province_code
Instance Method Details
#address ⇒ Object
5
6
7
|
# File 'lib/geocoder/results/azure.rb', line 5
def address
@data['address']['freeformAddress']
end
|
#building_number ⇒ Object
9
10
11
|
# File 'lib/geocoder/results/azure.rb', line 9
def building_number
@data['address']['buildingNumber']
end
|
#city ⇒ Object
13
14
15
|
# File 'lib/geocoder/results/azure.rb', line 13
def city
@data['address']['municipality']
end
|
#coordinates ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/geocoder/results/azure.rb', line 17
def coordinates
if @data['position'].is_a?(String) @data['position'].split(',').map(&:to_f)
elsif @data['position'].is_a?(Hash) [@data['position']['lat'], @data['position']['lon']]
end
end
|
#country ⇒ Object
25
26
27
|
# File 'lib/geocoder/results/azure.rb', line 25
def country
@data['address']['country']
end
|
#country_code ⇒ Object
29
30
31
|
# File 'lib/geocoder/results/azure.rb', line 29
def country_code
@data['address']['countryCode']
end
|
#district ⇒ Object
33
34
35
|
# File 'lib/geocoder/results/azure.rb', line 33
def district
@data['address']['municipalitySubdivision']
end
|
#postal_code ⇒ Object
37
38
39
|
# File 'lib/geocoder/results/azure.rb', line 37
def postal_code
@data['address']['postalCode']
end
|
#province ⇒ Object
41
42
43
|
# File 'lib/geocoder/results/azure.rb', line 41
def province
@data['address']['countrySubdivision']
end
|
#state ⇒ Object
45
46
47
|
# File 'lib/geocoder/results/azure.rb', line 45
def state
@data['address']['countrySubdivision']
end
|
#state_code ⇒ Object
49
50
51
|
# File 'lib/geocoder/results/azure.rb', line 49
def state_code
@data['address']['countrySubdivisionCode']
end
|
#street_name ⇒ Object
53
54
55
|
# File 'lib/geocoder/results/azure.rb', line 53
def street_name
@data['address']['streetName']
end
|
#street_number ⇒ Object
57
58
59
|
# File 'lib/geocoder/results/azure.rb', line 57
def street_number
@data['address']['streetNumber']
end
|
#viewport ⇒ Object
61
62
63
|
# File 'lib/geocoder/results/azure.rb', line 61
def viewport
@data['viewport'] || {}
end
|