Mercurial > hg > soundsoftware-site
comparison lib/redmine/.svn/text-base/hook.rb.svn-base @ 37:94944d00e43c
* Update to SVN trunk rev 4411
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 19 Nov 2010 13:24:41 +0000 |
parents | 513646585e45 |
children |
comparison
equal
deleted
inserted
replaced
22:40f7cfd4df19 | 37:94944d00e43c |
---|---|
55 end | 55 end |
56 | 56 |
57 # Calls a hook. | 57 # Calls a hook. |
58 # Returns the listeners response. | 58 # Returns the listeners response. |
59 def call_hook(hook, context={}) | 59 def call_hook(hook, context={}) |
60 returning [] do |response| | 60 [].tap do |response| |
61 hls = hook_listeners(hook) | 61 hls = hook_listeners(hook) |
62 if hls.any? | 62 if hls.any? |
63 hls.each {|listener| response << listener.send(hook, context)} | 63 hls.each {|listener| response << listener.send(hook, context)} |
64 end | 64 end |
65 end | 65 end |