Method: DataMapper::Hook::ClassMethods#after

Defined in:
lib/dm-core/support/hook.rb

#after(target_method, method_sym = nil, &block) ⇒ Object

Note:

Either method_sym or block is required.

Inject code that executes after the target instance method.

-

Parameters:

  • target_method (Symbol)

    the name of the instance method to inject after

  • method_sym (Symbol) (defaults to: nil)

    the name of the method to run after the target_method

  • block (Block)

    the code to run after the target_method



103
104
105
# File 'lib/dm-core/support/hook.rb', line 103

def after(target_method, method_sym = nil, &block)
  install_hook :after, target_method, method_sym, :instance, &block
end