# File lib/net/yail.rb, line 565 def handle(event, *arguments) # Don't bother with anything if there are no handlers registered. return unless Array === @handlers[event] report "+++EVENT HANDLER: Handling event #{event} via #{@handlers[event].inspect}:" if @loud # Call all hooks in order until one breaks the chain. For incoming # events, we want something to break the chain or else it'll likely # hit a reporter. For outgoing events, we tend to report them anyway, # so no need to worry about ending the chain except when the bot wants # to take full control over them. result = false for handler in @handlers[event] result = handler.call(*arguments) break if result == true end end