Class: ForemanHooks::OrchestrationHook::HookRunner
- Inherits:
-
Object
- Object
- ForemanHooks::OrchestrationHook::HookRunner
- Defined in:
- lib/foreman_hooks/orchestration_hook.rb
Overview
Orchestration runs methods against an object, so generate a runner for each hook that will need executing
Instance Method Summary collapse
- #args ⇒ Object
- #hook_execute_del ⇒ Object
- #hook_execute_set ⇒ Object
-
#initialize(filename, obj, event) ⇒ HookRunner
constructor
A new instance of HookRunner.
Constructor Details
#initialize(filename, obj, event) ⇒ HookRunner
Returns a new instance of HookRunner.
47 48 49 50 51 |
# File 'lib/foreman_hooks/orchestration_hook.rb', line 47 def initialize(filename, obj, event) @filename = filename @obj = obj @event = event end |
Instance Method Details
#args ⇒ Object
53 54 55 |
# File 'lib/foreman_hooks/orchestration_hook.rb', line 53 def args [@obj.to_s] end |
#hook_execute_del ⇒ Object
61 62 63 |
# File 'lib/foreman_hooks/orchestration_hook.rb', line 61 def hook_execute_del @obj.exec_hook(@filename, 'destroy', *args) end |
#hook_execute_set ⇒ Object
57 58 59 |
# File 'lib/foreman_hooks/orchestration_hook.rb', line 57 def hook_execute_set @obj.exec_hook(@filename, @event, *args) end |