Method: DataMapper::Hook::ClassMethods#register_class_hooks

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

#register_class_hooks(*hooks) ⇒ Object

Register a class method as hookable. Registering a method means that before hooks will be run immediately before the method is invoked and after hooks will be called immediately after the method is invoked.

-

Parameters:

  • hookable_method (Symbol)

    The name of the class method that should be hookable



115
116
117
# File 'lib/dm-core/support/hook.rb', line 115

def register_class_hooks(*hooks)
  hooks.each { |hook| register_hook(hook, :class) }
end