Project

inthegra

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for the STRANS-PI Inthegra API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 10.0
~> 3.0
~> 0.11.2
~> 2.0.2

Runtime

~> 0.9.2
 Project Readme

Inthegra

Ruby wrapper for the STRANS-PI Inthegra API.

Installation

Add this line to your application's Gemfile:

gem 'inthegra'

And then execute:

$ bundle

Or install it yourself as:

$ gem install inthegra

Usage

Require the inthegra gem and add the basic configuration:

require 'inthegra'

Inthegra.configure do |config|
  config.email = YOUR_INTHEGRA_EMAIL
  config.password = YOUR_INTHEGRA_PASSWORD
  config.api_key = YOUR_INTHEGRA_API_KEY
end

Create a new client instance and authenticate with the API.

client = Inthegra::Client.new

client.authenticate

Remeber: The inthegra API expires the auth_token after every 10 minutes.

Now you can retrieve the API data.

client.vehicles

Get all lines

client.lines

Search line by query string

Searching all line with 'ininga' keyword.

client.line_search('ininga')

Get all bus stops

client.bus_stops

Search bus stops by query string

Searching all bus stops with 'ininga' keyword.

client.bus_stops_search('ininga')

Search bus stops by line

Searching all bus stops of the 402 line code.

client.bus_stops_by_line('0402')

Get vehicles

client.vehicles

Search vehicles by line

Searching vehicles of the 402 line code.

client.vehicles_by_line('0402')

Documentation

You can see then documentation in http://www.rubydoc.info/gems/inthegra/0.1.0.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/teresinahc/inthegra.

License

The gem is available as open source under the terms of the MIT License.