Ruby client for the Swiss public transport API at http://transport.opendata.ch
gem install transprt
#run example
ruby example.rb
To talk to the API, get a client:
require 'transprt'
client = Transprt::Client.new
See below how to use this client.
Hint: You may specify a mirror of the API other than http://transport.opendata.ch using the first argument of the constructor.
http://transport.opendata.ch/#locations
client.locations query: 'Geneva'
# => [{"id"=>"008501008", "name"=>"Genève", "score"=>"101", "coordinate"=>{"type"=>"WGS84", "x"=>6.142455, "y"=>46.210199}, "distance"=>nil}]
http://transport.opendata.ch/#connections
client.connections from: 'Lausanne', to: 'Geneva'
http://transport.opendata.ch/#stationboard
# Display station board
client.stationboard station: 'Lausanne'
Running the tests
rake test
MIT License (MIT)