Class: Geocoder::Result::Latlon
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Latlon
show all
- Defined in:
- lib/geocoder/results/latlon.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
#city ⇒ Object
6
7
8
|
# File 'lib/geocoder/results/latlon.rb', line 6
def city
address_components["city"]
end
|
#coordinates ⇒ Object
10
11
12
|
# File 'lib/geocoder/results/latlon.rb', line 10
def coordinates
[@data['lat'].to_f, @data['lon'].to_f]
end
|
#country ⇒ Object
14
15
16
|
# File 'lib/geocoder/results/latlon.rb', line 14
def country
"United States" end
|
#country_code ⇒ Object
18
19
20
|
# File 'lib/geocoder/results/latlon.rb', line 18
def country_code
"US" end
|
22
23
24
|
# File 'lib/geocoder/results/latlon.rb', line 22
def formatted_address(format = :full)
address_components["address"]
end
|
#number ⇒ Object
27
28
29
|
# File 'lib/geocoder/results/latlon.rb', line 27
def number
address_components["number"]
end
|
#prefix ⇒ Object
31
32
33
|
# File 'lib/geocoder/results/latlon.rb', line 31
def prefix
address_components["prefix"]
end
|
#state ⇒ Object
Also known as:
state_code
35
36
37
|
# File 'lib/geocoder/results/latlon.rb', line 35
def state
address_components["state"]
end
|
#street ⇒ Object
40
41
42
|
# File 'lib/geocoder/results/latlon.rb', line 40
def street
[street_name, street_type].compact.join(' ')
end
|
#street_name ⇒ Object
44
45
46
|
# File 'lib/geocoder/results/latlon.rb', line 44
def street_name
address_components["street_name"]
end
|
#street_type ⇒ Object
48
49
50
|
# File 'lib/geocoder/results/latlon.rb', line 48
def street_type
address_components["street_type"]
end
|
#suffix ⇒ Object
52
53
54
|
# File 'lib/geocoder/results/latlon.rb', line 52
def suffix
address_components["suffix"]
end
|
#unit ⇒ Object
56
57
58
|
# File 'lib/geocoder/results/latlon.rb', line 56
def unit
address_components["unit"]
end
|
#zip ⇒ Object
Also known as:
postal_code
60
61
62
|
# File 'lib/geocoder/results/latlon.rb', line 60
def zip
address_components["zip"]
end
|