Class: Geocoder::Result::Esri

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/results/esri.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

Constructor Details

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

Instance Method Details

#addressObject



6
7
8
9
# File 'lib/geocoder/results/esri.rb', line 6

def address
  address = reverse_geocode? ? 'Address' : 'Match_addr'
  attributes[address]
end

#cityObject



11
12
13
# File 'lib/geocoder/results/esri.rb', line 11

def city
  attributes['City']
end

#coordinatesObject



32
33
34
# File 'lib/geocoder/results/esri.rb', line 32

def coordinates
  [geometry["y"], geometry["x"]]
end

#countryObject Also known as: country_code



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

def country
  country = reverse_geocode? ? "CountryCode" : "Country"
  attributes[country]
end

#postal_codeObject



28
29
30
# File 'lib/geocoder/results/esri.rb', line 28

def postal_code
  attributes['Postal']
end

#state_codeObject Also known as: state



15
16
17
# File 'lib/geocoder/results/esri.rb', line 15

def state_code
  attributes['Region']
end