Class: Geocoder::Result::Yahoo

Inherits:
Base
  • Object
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

Constructor Details

This class inherits a constructor from Geocoder::Result::Base

Class Method Details

.response_attributesObject


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_hashObject


34
35
36
# File 'lib/geocoder/results/yahoo.rb', line 34

def address_hash
  @data['hash']
end

#cityObject


10
11
12
# File 'lib/geocoder/results/yahoo.rb', line 10

def city
  @data['city']
end

#countryObject


22
23
24
# File 'lib/geocoder/results/yahoo.rb', line 22

def country
  @data['country']
end

#country_codeObject


26
27
28
# File 'lib/geocoder/results/yahoo.rb', line 26

def country_code
  @data['countrycode']
end

#postal_codeObject


30
31
32
# File 'lib/geocoder/results/yahoo.rb', line 30

def postal_code
  @data['postal']
end

#stateObject


14
15
16
# File 'lib/geocoder/results/yahoo.rb', line 14

def state
  @data['state']
end

#state_codeObject


18
19
20
# File 'lib/geocoder/results/yahoo.rb', line 18

def state_code
  @data['statecode']
end