Class: AbstractController::Callbacks::ActionFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/abstract_controller/callbacks.rb

Overview

:nodoc:

Instance Method Summary collapse

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

Returns:

  • (Boolean)


43
44
45
# File 'lib/abstract_controller/callbacks.rb', line 43

def match?(controller)
  @actions.include?(controller.action_name)
end