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.
8 9 10 |
# File 'lib/hook_handler.rb', line 8 def initialize(config) @config = config end |
Instance Method Details
#do_hooks(name) ⇒ Object
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 |