Implement Dispatcher#emit

This commit is contained in:
Thibault Jouan
2015-04-08 23:37:02 +00:00
parent ca8f60365f
commit 7becda9f31
2 changed files with 24 additions and 0 deletions

View File

@@ -16,6 +16,10 @@ module Uh
@hooks[translate_key key] << block
end
def emit *key
@hooks[translate_key key].tap { |o| o.each { |e| e.call } if o }
end
private