Class: GoogleMapsJuice::Directions::Response

Inherits:
Endpoint::Response show all
Defined in:
lib/google_maps_juice/directions/response.rb

Defined Under Namespace

Classes: Route

Instance Method Summary collapse

Methods inherited from Endpoint::Response

#error?, #error_message, #limit_error?, #status, #zero_results?

Instance Method Details

#firstObject



15
16
17
# File 'lib/google_maps_juice/directions/response.rb', line 15

def first
  routes.first
end

#resultsObject



7
8
9
# File 'lib/google_maps_juice/directions/response.rb', line 7

def results
  self['routes']
end

#routesObject



11
12
13
# File 'lib/google_maps_juice/directions/response.rb', line 11

def routes
  results.map { |r| Route.new(r) }
end