jnunemaker/httparty — Issue #118: default_params is set for every instance
Author: Raynes
Created: 2012-01-16 23:05:05+00:00
State: open

I was playing around with the library, doing something like this:

```ruby
class Foo
include HTTParty
def initialize(apikey = nil)
if apikey
self.class.default_params :apikey => apikey
end
end
end
```

If I create an instance of this class, setting the api key to 'foo', and then create another instance of the class that doesn't set an API key at all, the default_params are the same as the first instance. It appears that default_params is setting the default for every instance of my class. Is this expected behavior? If so, what is this intended to be used for? I'm not sure how it could be useful, but I'm probably just not getting what it is designed for in the first place. I haven't actually tried it, but it looks to me like, if you have x instance of the class and you create y instance setting default_params to something else, it would break instance x.