edge badge

Provides callbacks to be executed before and after dispatching the request.

Methods
A
B
C
N
T
Included Modules
Class Public methods
after(*args, &block)
# File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 25
def after(*args, &block)
  set_callback(:call, :after, *args, &block)
end
before(*args, &block)
# File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 21
def before(*args, &block)
  set_callback(:call, :before, *args, &block)
end
new(app)
# File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 30
def initialize(app)
  @app = app
end
to_cleanup(*args, &block)
# File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 14
def to_cleanup(*args, &block)
  ActiveSupport::Reloader.to_complete(*args, &block)
end
to_prepare(*args, &block)
# File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 10
def to_prepare(*args, &block)
  ActiveSupport::Reloader.to_prepare(*args, &block)
end
Instance Public methods
call(env)
# File actionpack/lib/action_dispatch/middleware/callbacks.rb, line 34
def call(env)
  error = nil
  result = run_callbacks :call do
    begin
      @app.call(env)
    rescue => error
    end
  end
  raise error if error
  result
end