Class: HookHandler
- Inherits:
-
Object
- Object
- HookHandler
- Defined in:
- lib/hook_handler.rb
Defined Under Namespace
Classes: HookConfigError, HookExecError
Instance Method Summary collapse
- #do_hooks(name) ⇒ Object
-
#initialize(config) ⇒ HookHandler
constructor
A new instance of HookHandler.
Constructor Details
#initialize(config) ⇒ HookHandler
Returns a new instance of HookHandler.
7 8 9 |
# File 'lib/hook_handler.rb', line 7 def initialize(config) @config = config end |
Instance Method Details
#do_hooks(name) ⇒ Object
11 12 13 14 15 |
# File 'lib/hook_handler.rb', line 11 def do_hooks(name) raise HookConfigError, "'hooks.#{name}' must be a list" unless hooks(name).is_a?(Array) execute_hooks(name) end |