Module: Charyf::Controller::Actions::ClassMethods

Defined in:
lib/charyf/engine/controller/actions.rb

Instance Method Summary collapse

Instance Method Details

#_before_actions(action) ⇒ Object



17
18
19
# File 'lib/charyf/engine/controller/actions.rb', line 17

def _before_actions(action)
  (@_before_actions || {}).select { |_,v| Charyf::Utils.match_action_filters?(action.to_sym, v) }.keys
end

#before_action(method_name, only: [], except: []) ⇒ Object



13
14
15
# File 'lib/charyf/engine/controller/actions.rb', line 13

def before_action(method_name, only: [], except: [])
  (@_before_actions ||= {})[method_name] = Charyf::Utils.create_action_filters(only, except)
end