Module: EventMachine::IRC::Responses::ClassMethods

Defined in:
lib/em-irc/responses.rb

Instance Method Summary collapse

Instance Method Details

#server_reply(*cmds, &blk) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/em-irc/responses.rb', line 37

def server_reply(*cmds, &blk)
  cmds << cmds.first if cmds.size == 1
  self.server_callbacks ||= {}
  self.server_callbacks[cmds.first] = {
    :name     => cmds.last,
    :callback => block_given? ? blk : lambda {|m|
      trigger(cmd.last.downcase.to_sym, *m[:params])
    }
  }
end