Code Climate Test Coverage

Strutta::Api

Official wrapper for the Strutta API

Installation

Add this line to your application's Gemfile:

gem 'strutta-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install strutta-api

Usage

This Gem is designed to have is calls resemble actual API URIs.

For example, if we want to get Rounds in Game 333, we would GET the following URI:

http://api.strutta.com/v2/games/333/rounds

The Gem copies this pattern:

# Initialize
strutta = Strutta::API.new 'mystruttatoken'

# Get Rounds in Game 333
strutta.games(333).rounds.get

There are detailed examples for each endpoint found in the Strutta API docs.

Errors

This Gem Raises exceptions whenever anything other than a 200, 201 or 204 is returned. The errors are defined in lib/strutta/api/errors and generated Strutta::Api#error_map.

Contributing

  1. Fork it ( http://github.com//strutta-api/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request