Ruby::Irail
IRail makes Belgian railway schedule easily available for anyone.
Check it out on http://project.irail.be/ or http://data.irail.be/
There are already several wrappers available in different languages. This is a Ruby wrapper for their API.
Installation
Add this line to your application's Gemfile:
gem 'ruby-irail'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruby-irail
Usage
require "ruby-irail"
irail = IRail::API.new(:stib)
irail.stations
irail = IRail::API.new
train_stations = irail.stations
origin = train_stations.first
destination = train_stations.last
irail.connections(origin, destination)
irail.vehicle("BE.NMBS.IC2240")
irail.departures("BE.NMBS.008813003")
irail.arrivals("BE.NMBS.008813003")
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
)
- Commit your changes (
git commit -am 'Added some feature'
)
- Push to the branch (
git push origin my-new-feature
)
- Create new Pull Request
Running the tests
All tests are in the specs folder. To run them simply run the following from the root folder of your fork:
rspec
Contributors
Marc Lainez (@mlainez)