Project

rome2rio

0.01
No commit activity in last 3 years
No release in over 3 years
A Ruby wrapper for the Rome2rio API. See http://www.rome2rio.com/documentation/search for the official documentation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Rome2rio

A Ruby wrapper for the Rome2rio API. See http://www.rome2rio.com/documentation/search for the official documentation.

Installation

gem install rome2rio

Usage

require 'rome2rio'
results = Rome2rio::Connection.new.search(search options)
puts results.routes[0].duration

All field names (both request and response) use the original naming as in the API documentation.

The API key and endpoint URL both can be set when creating an instance, but they can be overwritten by passing them for a request.

Complex datatypes (such as Position, Size, Offset, DayFlags) will be parsed.

Using Position for input:

Rome2rio::Connection.new.search({:oPos => Rome2rio::Position.new(41.79443,12.25108), :dPos => Rome2rio::Position.new(-22.81215,-43.24721)})

The original JSON response is also available in the verbatim field.

Copyright

Made for Soundtravel (http://soundtravel.co/).

Copyright (c) 2013 Alex Beregszaszi. See LICENSE for details.