futuresimple/api_client — pull request #11 by jasonayre (2014-11-06 21:31:11+00:00)
Title: Add support for default headers via config, and in place attribute updates

Per https://github.com/basecrm/basecrm/issues/17

1) Added a config class where you can specify default headers, which can get around the issue of the headers not being passed down when instantiating resources.

So now I can do:
``` ruby
ApiClient.configure do |config|
config.default_headers = {"X-Pipejump-Auth"=> BASE_API_TOKEN, "X-Futuresimple-Token"=> BASE_API_TOKEN}
end
```

And not be forced into instantiating client sessions, which like I said is very useful for single organizations.

2) save had no support for updating the resource attributes in place i.e.

``` ruby
lead = session.leads.new({:last_name => "asdasd"})
lead.save
puts lead
#would yield
Lead last_name: "asdasd"
```

Now it maps the attributes of the result back to the original instance