Module: Lepus::Processes::Callbacks::ClassMethods

Defined in:
lib/lepus/processes/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#after_boot(*methods) ⇒ Object



41
42
43
44
# File 'lib/lepus/processes/callbacks.rb', line 41

def after_boot(*methods)
  @after_boot_callbacks ||= []
  @after_boot_callbacks.concat methods
end

#after_shutdown(*methods) ⇒ Object



51
52
53
54
# File 'lib/lepus/processes/callbacks.rb', line 51

def after_shutdown(*methods)
  @after_shutdown_callbacks ||= []
  @after_shutdown_callbacks.concat methods
end

#before_boot(*methods) ⇒ Object



36
37
38
39
# File 'lib/lepus/processes/callbacks.rb', line 36

def before_boot(*methods)
  @before_boot_callbacks ||= []
  @before_boot_callbacks.concat methods
end

#before_shutdown(*methods) ⇒ Object



46
47
48
49
# File 'lib/lepus/processes/callbacks.rb', line 46

def before_shutdown(*methods)
  @before_shutdown_callbacks ||= []
  @before_shutdown_callbacks.concat methods
end

#inherited(base) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/lepus/processes/callbacks.rb', line 28

def inherited(base)
  base.instance_variable_set(:@before_boot_callbacks, before_boot_callbacks.dup)
  base.instance_variable_set(:@after_boot_callbacks, after_boot_callbacks.dup)
  base.instance_variable_set(:@before_shutdown_callbacks, before_shutdown_callbacks.dup)
  base.instance_variable_set(:@after_shutdown_callbacks, after_shutdown_callbacks.dup)
  super
end