Module: Praxis::Callbacks::ClassMethods

Defined in:
lib/praxis/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#after(*stage_path, **conditions, &block) ⇒ Object



21
22
23
24
25
# File 'lib/praxis/callbacks.rb', line 21

def after(*stage_path, **conditions, &block)
  stage_path = [:action] if stage_path.empty?
  after_callbacks[stage_path] ||= []
  after_callbacks[stage_path] << [conditions, block]
end

#around(*stage_path, **conditions, &block) ⇒ Object



27
28
29
30
31
# File 'lib/praxis/callbacks.rb', line 27

def around(*stage_path, **conditions, &block)
  stage_path = [:action] if stage_path.empty?
  around_callbacks[stage_path] ||= []
  around_callbacks[stage_path] << [conditions, block]
end

#before(*stage_path, **conditions, &block) ⇒ Object



15
16
17
18
19
# File 'lib/praxis/callbacks.rb', line 15

def before(*stage_path, **conditions, &block)
  stage_path = [:action] if stage_path.empty?
  before_callbacks[stage_path] ||= []
  before_callbacks[stage_path] << [conditions, block]
end