mLewisLogic/saddle — pull request #6 by nelgau (2013-11-24 09:38:38+00:00)
Title: Pass arguments to adapters

Although Saddle permits the specification of arbitrary Faraday adapters, there's presently no way to pass arguments to the initializer. This pull request extends the `:http_adapter` client option to specify both in a backward-compatible manner. Now it's possible to make good use of all third-party adapters. ;)

```ruby
def self.http_adapter
{
:key => :thrawn,
:args => [{
:strategy => :synapse,
:down_failures => 2,
:down_retry_delay => 30,
:max_requests => 100
}]
}
end
```

*The decision to use `:key` to designate the registered symbol of an adapter middleware was motivated by the internal name given to it in Faraday. See* https://github.com/lostisland/faraday/blob/master/lib/faraday/rack_builder.rb#L99.

/cc @mLewisLogic