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.



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

def initialize(config)
	@config = config
end

Instance Method Details

#do_hooks(name) ⇒ Object

Raises:



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

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

	execute_hooks(name)
end