Method: Ardm::Hook::ClassMethods#before_class_method

Defined in:
lib/ardm/support/hook.rb

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

Note:

Either method_sym or block is required.

Inject code that executes before the target class method.

-

Parameters:

  • the name of the class method to inject before

  • (defaults to: nil)

    the name of the method to run before the target_method

  • the code to run before the target_method

API:

  • public



59
60
61
# File 'lib/ardm/support/hook.rb', line 59

def before_class_method(target_method, method_sym = nil, &block)
  install_hook :before, target_method, method_sym, :class, &block
end