Socket
Book a DemoInstallSign in
Socket

ruby-irail

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ruby-irail

0.4.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

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"

# get a list of all mivb/stib stations in brussels

irail = IRail::API.new(:stib) # use :mivb symbol instead of :stib if you want
irail.stations

# get a list of all belgian train stations

irail          = IRail::API.new # by default it takes the nmbs/sncb provider but you can also use :sncb or :nmbs symbols
train_stations = irail.stations

# get train trips from one station to another

origin      = train_stations.first
destination = train_stations.last
irail.connections(origin, destination)

#get train trip information (all stops for a train)

irail.vehicle("BE.NMBS.IC2240") # the vehicle ids cans be found when querying for a connection

#get departures from a specific station

irail.departures("BE.NMBS.008813003") # get station identifiers from the stations call

#get arrivals to a specific station

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)

FAQs

Package last updated on 20 Jul 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.