Class: AbstractController::Callbacks::ActionFilter
- Inherits:
-
Object
- Object
- AbstractController::Callbacks::ActionFilter
- Defined in:
- lib/abstract_controller/callbacks.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(actions) ⇒ ActionFilter
constructor
A new instance of ActionFilter.
- #match?(controller) ⇒ Boolean (also: #after, #before, #around)
Constructor Details
#initialize(actions) ⇒ ActionFilter
Returns a new instance of ActionFilter.
39 40 41 |
# File 'lib/abstract_controller/callbacks.rb', line 39 def initialize(actions) @actions = Array(actions).map(&:to_s).to_set end |
Instance Method Details
#match?(controller) ⇒ Boolean Also known as: after, before, around
43 44 45 |
# File 'lib/abstract_controller/callbacks.rb', line 43 def match?(controller) @actions.include?(controller.action_name) end |