Method: TollBooth::Route.find

Defined in:
lib/toll_booth/route.rb

.find(origin, destinations) ⇒ TollBooth::RouteCollection

get driving directions from the origin to the specified destination(s)

Parameters:

  • origin (TollBooth::Location)

    the starting point for the trip

  • destinations (Array)

    a list of destinations to drive to

Returns:



16
17
18
19
20
21
22
23
# File 'lib/toll_booth/route.rb', line 16

def find(origin, destinations)
  response = get("", 
    :query => {:q => "from: #{origin.description} " + 
      destinations.collect{|d| " to: #{d.description}"}.join("")}) 
  routes = parse(response)

  routes
end