toll_booth¶ ↑
@origin = TollBooth::Location.new("4 Yawkey Way, Boston, MA") @destination = TollBooth::Location.new("1 Fleetcenter Place, Boston, MA") @routes = @origin.drive_to(@destination) if @routes.found? @routes[0].distance #distance in miles @routes[0].drive_time #drive time in seconds @routes[0].name #name of route (usually specified when multiple routes are returned) @routes[0].steps #array of TollBooth::Steps to take @routes[0].steps[0].distance #distance of step in miles @routes[0].steps[0].description #summary of step else puts @routes.errors.join(",") end
Links of Interest¶ ↑
TODO¶ ↑
-
Allow Configuration for Key
-
Some unit testing with FakeWeb for 100% coverage
-
Fix distance parsing for when distance is expressed in ft
-
public transit directions
-
Walking directions
Note on Patches/Pull Requests¶ ↑
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history.
-
Send me a pull request. Bonus points for topic branches.
Copyright¶ ↑
Copyright © 2009 Dan Pickett. See LICENSE for details.