class Faraday::Response::Middleware

def on_complete(env)

Calls the `parse` method if defined
Override this to modify the environment after the response has finished.
def on_complete(env)
  env.body = parse(env.body) if respond_to?(:parse) && env.parse_body?
end