Class: Geocoder::Result::Yahoo

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/results/yahoo.rb

Instance Attribute Summary

Attributes inherited from Base

#data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#coordinates, #initialize, #latitude, #longitude

Constructor Details

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

Class Method Details

.response_attributesObject



26
27
28
29
30
31
32
# File 'lib/geocoder/results/yahoo.rb', line 26

def self.response_attributes
  %w[quality offsetlat offsetlon radius boundingbox name
    line1 line2 line3 line4 cross house street xstreet unittype unit postal
    neighborhood city county state country countrycode statecode 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

#cityObject



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

def city
  @data['city']
end

#countryObject



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

def country
  @data['country']
end

#country_codeObject



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

def country_code
  @data['countrycode']
end

#postal_codeObject



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

def postal_code
  @data['postal']
end