Module: AutomationObject::CompositeHook::ClassMethods

Defined in:
lib/automation_object/helpers/composite_hook.rb

Overview

Class level methods

Instance Method Summary collapse

Instance Method Details

#after_create(instance_method) ⇒ Object

Parameters:

  • instance_method (Symbol)

    method to call



26
27
28
# File 'lib/automation_object/helpers/composite_hook.rb', line 26

def after_create(instance_method)
  after_create_hooks.push(instance_method)
end

#after_create_hooksArray<Symbol>

Returns list of methods to call

Returns:

  • (Array<Symbol>)

    list of methods to call



31
32
33
34
# File 'lib/automation_object/helpers/composite_hook.rb', line 31

def after_create_hooks
  @after_create_hooks = [] unless defined? @after_create_hooks
  @after_create_hooks
end

#before_create(instance_method) ⇒ Object

Parameters:

  • instance_method (Symbol)

    method to call



37
38
39
# File 'lib/automation_object/helpers/composite_hook.rb', line 37

def before_create(instance_method)
  before_create_hooks.push(instance_method)
end

#before_create_hooksArray<Symbol>

Returns list of methods to call

Returns:

  • (Array<Symbol>)

    list of methods to call



42
43
44
45
# File 'lib/automation_object/helpers/composite_hook.rb', line 42

def before_create_hooks
  @before_create_hooks = [] unless defined? @before_create_hooks
  @before_create_hooks
end