Class: HookHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/hook_handler.rb

Defined Under Namespace

Classes: HookConfigError, HookExecError

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ HookHandler

Returns a new instance of HookHandler.


9
10
11
# File 'lib/hook_handler.rb', line 9

def initialize(config)
	@config = config
end

Instance Method Details

#do_hooks(name) ⇒ Object

Raises:


13
14
15
16
17
# File 'lib/hook_handler.rb', line 13

def do_hooks(name)
	raise HookConfigError, "'hooks.#{name}' must be a list" unless hooks(name).is_a?(Array)

	execute_hooks(name)
end