Class: ActionController::Filters::AroundFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/action_controller/filters.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Filter

#after?, #around?, #before?

Instance Method Details

#call(controller, &block) ⇒ Object



148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/action_controller/filters.rb', line 148

def call(controller, &block)
  if should_run_callback?(controller)
    method = filter_responds_to_before_and_after? ? around_proc : self.method

    # For around_filter do |controller, action|
    if method.is_a?(Proc) && method.arity == 2
      evaluate_method(method, controller, block)
    else
      evaluate_method(method, controller, &block)
    end
  else
    block.call
  end
end

#typeObject



144
145
146
# File 'lib/action_controller/filters.rb', line 144

def type
  :around
end