Class: MapQuest::Services::Geocoding::Response

Inherits:
Response
  • Object
show all
Defined in:
lib/mapquest/services/geocoding.rb

Instance Attribute Summary

Attributes inherited from Response

#params, #response, #valid

Instance Method Summary collapse

Methods inherited from Response

#copyright, #info, #options, #status, #valid_request?

Constructor Details

#initialize(response_string, params = {}) ⇒ Response

Returns a new instance of Response.



44
45
46
# File 'lib/mapquest/services/geocoding.rb', line 44

def initialize(response_string, params = {})
  super
end

Instance Method Details

#locationsObject



48
49
50
51
52
# File 'lib/mapquest/services/geocoding.rb', line 48

def locations
  if valid
    response[:results].first[:locations]
  end
end

#providedLocationObject



54
55
56
57
58
# File 'lib/mapquest/services/geocoding.rb', line 54

def providedLocation
  if valid
    response[:results].first[:providedLocation]
  end
end