self.class.post(...) do |response| response.error! unless response.success? end
The response instance won’t find these
#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 = self.class.post(...) response.error! unless response.success? response