Module: OverSIP::SystemCallbacks

Extended by:
Logger
Defined in:
lib/oversip/system_callbacks.rb

Overview

This module is intended for 3rd party modules that need custom code to be executed when OverSIP is started, reloaded or terminated.

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Logger

fg_system_msg2str, load_methods, log_id

Class Attribute Details

.on_reload_callbacksObject (readonly)

Returns the value of attribute on_reload_callbacks.



15
16
17
# File 'lib/oversip/system_callbacks.rb', line 15

def on_reload_callbacks
  @on_reload_callbacks
end

.on_started_callbacksObject (readonly)

Returns the value of attribute on_started_callbacks.



13
14
15
# File 'lib/oversip/system_callbacks.rb', line 13

def on_started_callbacks
  @on_started_callbacks
end

.on_terminated_callbacksObject (readonly)

Returns the value of attribute on_terminated_callbacks.



14
15
16
# File 'lib/oversip/system_callbacks.rb', line 14

def on_terminated_callbacks
  @on_terminated_callbacks
end

Class Method Details

.on_reload(pr = nil, &bl) ⇒ Object

Raises:

  • (::ArgumentError)


36
37
38
39
40
41
# File 'lib/oversip/system_callbacks.rb', line 36

def self.on_reload pr=nil, &bl
  block = pr || bl
  raise ::ArgumentError, "no block given"  unless block.is_a? ::Proc

  @on_reload_callbacks << block
end

.on_started(pr = nil, &bl) ⇒ Object

Raises:

  • (::ArgumentError)


22
23
24
25
26
27
# File 'lib/oversip/system_callbacks.rb', line 22

def self.on_started pr=nil, &bl
  block = pr || bl
  raise ::ArgumentError, "no block given"  unless block.is_a? ::Proc

  @on_started_callbacks << block
end

.on_terminated(pr = nil, &bl) ⇒ Object

Raises:

  • (::ArgumentError)


29
30
31
32
33
34
# File 'lib/oversip/system_callbacks.rb', line 29

def self.on_terminated pr=nil, &bl
  block = pr || bl
  raise ::ArgumentError, "no block given"  unless block.is_a? ::Proc

  @on_terminated_callbacks << block
end