Class: GoogleGeocodeApi::Response

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

Overview

Response object formatted from Google API response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



8
9
10
11
# File 'lib/google_geocode_api/response.rb', line 8

def initialize(response)
  @raw_response = Object.new response.body
  @results = @raw_response.results.map { |result| Address.new result }
end

Instance Attribute Details

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



6
7
8
# File 'lib/google_geocode_api/response.rb', line 6

def raw_response
  @raw_response
end

#resultsObject (readonly)

Returns the value of attribute results.



6
7
8
# File 'lib/google_geocode_api/response.rb', line 6

def results
  @results
end