Class: ActionController::Filters::ClassMethods::BeforeFilterProxy

Inherits:
FilterProxy show all
Defined in:
lib/action_controller/filters.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Filter

#excluded_actions, #filter, #included_actions

Instance Method Summary collapse

Methods inherited from FilterProxy

#around?, #filter

Methods inherited from Filter

#after?, #around?, #initialize

Constructor Details

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

Instance Method Details

#before?Boolean

Returns:

  • (Boolean)


430
431
432
# File 'lib/action_controller/filters.rb', line 430

def before?
  true
end

#call(controller, &block) ⇒ Object



434
435
436
437
438
439
440
# File 'lib/action_controller/filters.rb', line 434

def call(controller, &block)
  if false == @filter.call(controller) # must only stop if equal to false. only filters returning false are halted.
    controller.halt_filter_chain(@filter, :returned_false)
  else
    yield
  end
end