Class/Module Index [+]

Quicksearch

Faraday::Response::Middleware

Used for simple response middleware.

Public Instance Methods

call(env) click to toggle source
# File lib/faraday/response.rb, line 7
def call(env)
  @app.call(env).on_complete do |environment|
    on_complete(environment)
  end
end
on_complete(env) click to toggle source

Override this to modify the environment after the response has finished. Calls the `parse` method if defined

# File lib/faraday/response.rb, line 15
def on_complete(env)
  env.body = parse(env.body) if respond_to?(:parse) && env.parse_body?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.