agoragames/strumbar — pull request #9 by cadwallion (2013-02-09 22:01:50+00:00)
Title: Adds options hash to instrument loading

In the old instrumentation block, instruments were able to pass an options hash to them for things like rate
limits. In order to continue providing this in the new API, an options hash has been added to
`Strumbar::InstrumentList#use`.

When adding an instrument, a hash can be passed and will be send to the object upon loading. If no hash is
passed, a hash containing Strumbar's default_rate will be passed.

When adding an array of instruments, the hash passed will be applied to ALL instruments passed in the array.

For example:

```
Strumbar.configure do |config|
# Can pass optional hash of data to controller for access when loading
config.instruments.use Strumbar::Instrumentation::ActiveRecord, rate: 0.8
config.instruments.use Strumbar::Instrumentation::ActionController, rate: 1.0

# Unless passed, `rate` will be passed as the value of Strumbar.default_rate
config.instruments.use Strumbar::Instrumentation::Redis

# When passing an array of objects, each element of the array will use the
# same optional information, and will use the default rate if not supplied

# Guitar and SnareDrum will receive `{ rate: Strumbar.default_rate }`
config.instruments.use [Guitar, SnareDrum]

# SixStringBass and FourStringBass will receive the same hash
config.instruments.use [SixStringBass, FourStringBass], rate: 0.75
end
```