rightscale/rest_connection — pull request #13 by brettporter (2012-11-26 16:51:25+00:00)
Title: Ability to reconnect with different configuration

While unconventional, it is possible to configure a connection dynamically:

```ruby
settings = {
:user => username,
:pass => password,
:api_url => "https://my.rightscale.com/api/acct/#{account_id}",
:common_headers => {
'X_API_VERSION' => api_version
},
:azure_hack_on => true,
:azure_hack_retry_count => 5,
:azure_hack_sleep_seconds => 60,
:api_logging => false
}
Server.connect(settings)
```

However, it isn't possible to change that once connected, if you have a piece of code that might switch accounts or other settings. This simple patch allows that, though it still requires calling it on every resource that you might connect to.