Method: ExtraLoop::Hookable#set_hook
- Defined in:
- lib/extraloop/hookable.rb
#set_hook(hookname, &handler) ⇒ Object Also known as: on
9 10 11 12 13 |
# File 'lib/extraloop/hookable.rb', line 9 def set_hook(hookname, &handler) @hooks ||= {} @hooks[hookname.to_sym] ? @hooks[hookname.to_sym].push(handler) : @hooks[hookname.to_sym] = [handler] self end |