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

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

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages