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?, #before?, #initialize, #update_options!

Constructor Details

This class inherits a constructor from ActionController::Filters::Filter

Instance Method Details

#around?Boolean

Returns:

  • (Boolean)


174
175
176
# File 'lib/action_controller/filters.rb', line 174

def around?
  true
end

#call(controller, &block) ⇒ Object



178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/action_controller/filters.rb', line 178

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



170
171
172
# File 'lib/action_controller/filters.rb', line 170

def type
  :around
end