Class: MQProxyGeocode

Inherits:
Object
  • Object
show all
Defined in:
lib/mqproxy.rb

Overview

Class to handle MapQuest geocode request response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(geocode) ⇒ MQProxyGeocode

Initialize MQProxyGeocode and set standard data



82
83
84
85
86
87
88
89
90
91
# File 'lib/mqproxy.rb', line 82

def initialize(geocode)
  @raw = geocode
  @street = extract_data('street')
  @city = extract_data('adminArea5')
  @zip = extract_data('postalCode')
  @county = extract_data('adminArea4')
  @state = extract_data('adminArea3')
  @country = extract_data('adminArea1')
  @lng,@lat = extract_lat_lng
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



79
80
81
# File 'lib/mqproxy.rb', line 79

def city
  @city
end

#countryObject

Returns the value of attribute country.



79
80
81
# File 'lib/mqproxy.rb', line 79

def country
  @country
end

#countyObject

Returns the value of attribute county.



79
80
81
# File 'lib/mqproxy.rb', line 79

def county
  @county
end

#latObject

Returns the value of attribute lat.



79
80
81
# File 'lib/mqproxy.rb', line 79

def lat
  @lat
end

#lngObject

Returns the value of attribute lng.



79
80
81
# File 'lib/mqproxy.rb', line 79

def lng
  @lng
end

#rawObject

Returns the value of attribute raw.



79
80
81
# File 'lib/mqproxy.rb', line 79

def raw
  @raw
end

#stateObject

Returns the value of attribute state.



79
80
81
# File 'lib/mqproxy.rb', line 79

def state
  @state
end

#streetObject

Returns the value of attribute street.



79
80
81
# File 'lib/mqproxy.rb', line 79

def street
  @street
end

#zipObject

Returns the value of attribute zip.



79
80
81
# File 'lib/mqproxy.rb', line 79

def zip
  @zip
end