Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

A Ruby API wrapper for IDFM/STIF iLICO/Codifligne API

License

Notifications You must be signed in to change notification settings

enroute-mobi/stif-codifline-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Alban Peignier
Aug 28, 2019
bfee97f · Aug 28, 2019

History

50 Commits
Jun 28, 2019
May 29, 2019
Nov 5, 2018
Mar 12, 2018
Jan 27, 2016
May 9, 2019
Aug 28, 2019
Mar 12, 2018
Jan 29, 2016
Nov 5, 2018
Nov 5, 2018

Repository files navigation

Codifligne

Work in progress : An API wrapper for Stif Codifligne API

Dependencies

Ruby >= 2.1.0

Install

Build

git clone git@github.com:AF83/stif-codifline-api.git
cd stif-codifline-api
gem build codifligne.gemspec
gem install -l codifligne-0.0.1.gem

Add to your project

gem 'codifligne'
bundle install

Usage

# Retrieve all operators
client    = Codifligne::API.new
operators = client.operators

# Retrieve operators by transport_mode
operators = client.operators(transport_mode: 'fer')

# Retrieve all line  by operator name
lines = client.lines(operator_name: 'ADP')

You can set timeout and override api base url globally in your config/initializers/codifligne.rb

Codifligne::API.base_url = "https://codifligne.stif.info/rest/v1/lc/getlist"
Codifligne::API.timeout  = 50

Tests

cd stif-codifline-api
rspec spec/codifligne