Skip to content
/ transprt Public

Ruby client for the Swiss public transport API

License

Notifications You must be signed in to change notification settings

ghn/transprt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Germain
Jun 1, 2017
da609d3 · Jun 1, 2017

History

25 Commits
Jul 24, 2016
Jul 24, 2016
Nov 29, 2013
Jul 21, 2016
Jul 24, 2016
Jul 15, 2016
Jul 15, 2016
Aug 4, 2016
Sep 5, 2013
Jun 1, 2017
Jul 15, 2016
Jul 15, 2016
Aug 4, 2016

Repository files navigation

transprt

Gem Version Dependency Status Build Status

Ruby client for the Swiss public transport API at http://transport.opendata.ch

Installation

gem install transprt

#run example
ruby example.rb

Usage

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.

Locations

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}]

Connections

http://transport.opendata.ch/#connections

client.connections from: 'Lausanne', to: 'Geneva'

Station board

http://transport.opendata.ch/#stationboard

# Display station board
client.stationboard station: 'Lausanne'

Development

Running the tests

rake test

License

MIT License (MIT)

Packages

No packages published

Languages