Module: DeepCover::ExecCallbacks

Extended by:
ModuleOverride
Defined in:
lib/deep_cover/core_ext/exec_callbacks.rb

Class Attribute Summary collapse

Attributes included from ModuleOverride

#overriden_modules

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModuleOverride

active=, each, override

Class Attribute Details

.callbacksObject (readonly)

Returns the value of attribute callbacks.



10
11
12
# File 'lib/deep_cover/core_ext/exec_callbacks.rb', line 10

def callbacks
  @callbacks
end

Class Method Details

.before_exec(&block) ⇒ Object



12
13
14
15
# File 'lib/deep_cover/core_ext/exec_callbacks.rb', line 12

def before_exec(&block)
  self.active = true
  (@callbacks ||= []) << block
end

Instance Method Details

#exec(*args) ⇒ Object



18
19
20
21
# File 'lib/deep_cover/core_ext/exec_callbacks.rb', line 18

def exec(*args)
  ExecCallbacks.callbacks.each(&:call)
  exec_without_deep_cover(*args)
end