Class: Geocoder::Result::Yahoo
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Yahoo
show all
- Defined in:
- lib/geocoder/results/yahoo.rb
Instance Attribute Summary
Attributes inherited from Base
#cache_hit, #data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#coordinates, #initialize, #latitude, #longitude, #province, #province_code
Class Method Details
.response_attributes ⇒ Object
38
39
40
41
42
43
44
45
|
# File 'lib/geocoder/results/yahoo.rb', line 38
def self.response_attributes
%w[quality offsetlat offsetlon radius boundingbox name
line1 line2 line3 line4 cross house street xstreet unittype unit
city state statecode country countrycode postal
neighborhood county countycode
level0 level1 level2 level3 level4 level0code level1code level2code
timezone areacode uzip hash woeid woetype]
end
|
Instance Method Details
#address(format = :full) ⇒ Object
6
7
8
|
# File 'lib/geocoder/results/yahoo.rb', line 6
def address(format = :full)
(1..4).to_a.map{ |i| @data["line#{i}"] }.reject{ |i| i.nil? or i == "" }.join(", ")
end
|
#address_hash ⇒ Object
34
35
36
|
# File 'lib/geocoder/results/yahoo.rb', line 34
def address_hash
@data['hash']
end
|
#city ⇒ Object
10
11
12
|
# File 'lib/geocoder/results/yahoo.rb', line 10
def city
@data['city']
end
|
#country ⇒ Object
22
23
24
|
# File 'lib/geocoder/results/yahoo.rb', line 22
def country
@data['country']
end
|
#country_code ⇒ Object
26
27
28
|
# File 'lib/geocoder/results/yahoo.rb', line 26
def country_code
@data['countrycode']
end
|
#postal_code ⇒ Object
30
31
32
|
# File 'lib/geocoder/results/yahoo.rb', line 30
def postal_code
@data['postal']
end
|
#state ⇒ Object
14
15
16
|
# File 'lib/geocoder/results/yahoo.rb', line 14
def state
@data['state']
end
|
#state_code ⇒ Object
18
19
20
|
# File 'lib/geocoder/results/yahoo.rb', line 18
def state_code
@data['statecode']
end
|