lib/wmiirc/handler.rb
##
# Registers the given block as a handler for the given key
# and returns that handler, or if a block is not given,
# executes all handlers registered for the given key.
#
Registers the given block as a handler for the given key
and returns that handler, or if a block is not given,
executes all handlers registered for the given key.
Registers the given block as a handler for the given key and returns that handler or if a block is not given executes all handlers registered for the given key .
def handle key, *args, &block
      if block
        self[key] << block
      elsif key? key
        self[key].each do |block|
          block.call(*args)
        end
      end
      block
    end
def handle key , * args , & block if block self [ key ] << block elsif key? key self [ key ] . each do | block | block . call ( * args ) end end block end
Registers the given block as a handler for the given key
and returns that handler, or if a block is not given,
executes all handlers registered for the given key.
Registers the given block as a handler for the given key and returns that handler or if a block is not given executes all handlers registered for the given key .
key
<not_specific>
args
<not_specific>
block
<not_specific>