intridea/oauth2 — pull request #169 by knu (2014-04-10 15:51:50+00:00)
Title: Rename AccessToken#refresh! to refresh, leaving a compatibility alias.

This fixes #85 and #116.

Suffixing the method name with a bang may lead to a misconception that it may update the receiver especially when OAuth2::AccessToken is partially mutable.

I actually mistook it, and the following is a piece of my updated code.
```
def request(*args)
refreshed = false
begin
response = @token.request(*args)
rescue OAuth2::Error => e
raise if refreshed || e.response.parsed['errorCode'] != 401
@token = @token.refresh!
refreshed = true
retry
end
# ...
end
```
The `@token = @token.refresh!` part looks unfamiliar to me as a long time ruby programmer.