class ForemanHooks::OrchestrationHook::HookRunner

Orchestration runs methods against an object, so generate a runner for each hook that will need executing

Public Class Methods

new(filename, obj, event) click to toggle source
# File lib/foreman_hooks/orchestration_hook.rb, line 46
def initialize(filename, obj, event)
  @filename = filename
  @obj = obj
  @event = event
end

Public Instance Methods

args() click to toggle source
# File lib/foreman_hooks/orchestration_hook.rb, line 52
def args
  [@obj.to_s]
end
hook_execute_del() click to toggle source
# File lib/foreman_hooks/orchestration_hook.rb, line 60
def hook_execute_del
  @obj.exec_hook(@filename, 'destroy', *args)
end
hook_execute_set() click to toggle source
# File lib/foreman_hooks/orchestration_hook.rb, line 56
def hook_execute_set
  @obj.exec_hook(@filename, @event == 'destroy' ? 'create' : @event, *args)
end