Module: Praxis::Mapper::Resources::Callbacks::ClassMethods

Defined in:
lib/praxis/mapper/resources/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#after(method, function = nil, &block) ⇒ Object



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

def after(method, function = nil, &block)
  target = function ? function.to_sym : block
  after_callbacks[method] << target
end

#around(method, function = nil, &block) ⇒ Object



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

def around(method, function = nil, &block)
  target = function ? function.to_sym : block
  around_callbacks[method] << target
end

#before(method, function = nil, &block) ⇒ Object



17
18
19
20
# File 'lib/praxis/mapper/resources/callbacks.rb', line 17

def before(method, function = nil, &block)
  target = function ? function.to_sym : block
  before_callbacks[method] << target
end