Work in progress : An API wrapper for Stif Codifligne API
Ruby >= 2.1.0
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
cd stif-codifline-api
rspec spec/codifligne