Ruby wrapper for the STRANS-PI Inthegra API.
Add this line to your application's Gemfile:
gem 'inthegra'And then execute:
$ bundle
Or install it yourself as:
$ gem install inthegra
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
endCreate a new client instance and authenticate with the API.
client = Inthegra::Client.new
client.authenticateRemeber: The inthegra API expires the auth_token after every 10 minutes.
Now you can retrieve the API data.
client.vehiclesclient.linesSearching all line with 'ininga' keyword.
client.line_search('ininga')client.bus_stopsSearching all bus stops with 'ininga' keyword.
client.bus_stops_search('ininga')Searching all bus stops of the 402 line code.
client.bus_stops_by_line('0402')client.vehiclesSearching vehicles of the 402 line code.
client.vehicles_by_line('0402')You can see then documentation in http://www.rubydoc.info/gems/inthegra/0.1.0.
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.
Bug reports and pull requests are welcome on GitHub at https://github.com/teresinahc/inthegra.
The gem is available as open source under the terms of the MIT License.