HTTParty::Response doesn’t like tap

A small surprise by hacking rivendell-api, if you try to use Object#tap on HTTParty::Response like this : do |response|
  response.error! unless response.success?

The response instance won’t find these HTTParty::Response #error! or #success? methods (?).

In fact, the response variable isn’t a HTTParty::Response because of HTTParty::Response#method_missing which delegates the #tap method the parsed_response :-/

Without a tap, these 3 lines work fine :

response =
response.error! unless response.success?