Class: MQProxyGeocode
- Inherits:
-
Object
- Object
- MQProxyGeocode
- Defined in:
- lib/mqproxy.rb
Overview
Class to handle MapQuest geocode request response
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#county ⇒ Object
Returns the value of attribute county.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lng ⇒ Object
Returns the value of attribute lng.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street ⇒ Object
Returns the value of attribute street.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(geocode) ⇒ MQProxyGeocode
constructor
Initialize MQProxyGeocode and set standard data.
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
#city ⇒ Object
Returns the value of attribute city.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def country @country end |
#county ⇒ Object
Returns the value of attribute county.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def county @county end |
#lat ⇒ Object
Returns the value of attribute lat.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def lat @lat end |
#lng ⇒ Object
Returns the value of attribute lng.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def lng @lng end |
#raw ⇒ Object
Returns the value of attribute raw.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def raw @raw end |
#state ⇒ Object
Returns the value of attribute state.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def state @state end |
#street ⇒ Object
Returns the value of attribute street.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def street @street end |
#zip ⇒ Object
Returns the value of attribute zip.
79 80 81 |
# File 'lib/mqproxy.rb', line 79 def zip @zip end |