Module: IIRC::Verbs

Included in:
Batteries
Defined in:
lib/iirc/modules/verbs.rb

Instance Method Summary collapse

Instance Method Details

#act(target, msg) ⇒ Object



8
# File 'lib/iirc/modules/verbs.rb', line 8

def act(target, msg) for line in msg.to_s.lines; self << "PRIVMSG #{target} :\001ACTION #{line.chomp}\001"; end; self end

#cycle(target, reason = '') ⇒ Object



12
# File 'lib/iirc/modules/verbs.rb', line 12

def cycle(target, reason='') part(target, reason); join(target) end

#invite(target, channel) ⇒ Object



11
# File 'lib/iirc/modules/verbs.rb', line 11

def invite(target, channel) self << "INVITE #{target} #{channel}" end

#join(channel) ⇒ Object



3
# File 'lib/iirc/modules/verbs.rb', line 3

def join(channel) self << "JOIN #{channel}" end

#kick(channel, target, msg = '') ⇒ Object



19
# File 'lib/iirc/modules/verbs.rb', line 19

def kick(channel, target, msg='') self << "KICK #{channel} #{target} :#{msg}" end

#kill(target, msg = '.') ⇒ Object



18
# File 'lib/iirc/modules/verbs.rb', line 18

def kill(target, msg='.') self << "KILL #{target} :#{msg}" end

#mode(target, mode) ⇒ Object



16
# File 'lib/iirc/modules/verbs.rb', line 16

def mode(target, mode) self << "MODE #{target} #{mode}" end

#msg(target, msg) ⇒ Object Also known as: privmsg, say



7
# File 'lib/iirc/modules/verbs.rb', line 7

def msg(target, msg) for line in msg.to_s.lines; self << "PRIVMSG #{target} :#{line.chomp}"; end; self end

#names(channel) ⇒ Object



5
# File 'lib/iirc/modules/verbs.rb', line 5

def names(channel) self << "NAMES #{channel}" end

#nick(new) ⇒ Object



13
# File 'lib/iirc/modules/verbs.rb', line 13

def nick(new) self << "NICK #{new}" end

#notice(target, msg) ⇒ Object



9
# File 'lib/iirc/modules/verbs.rb', line 9

def notice(target,msg) for line in msg.to_s.lines; self << "NOTICE #{target} :#{line.chomp}"; end; self end

#part(channel, reason = nil) ⇒ Object



4
# File 'lib/iirc/modules/verbs.rb', line 4

def part(channel, reason=nil) self << "PART #{channel}#{" :#{reason}" if reason}" end

#ping(token = nil) ⇒ Object



14
# File 'lib/iirc/modules/verbs.rb', line 14

def ping(token=nil) self << (token ? "PING :#{token}" : "PING") end

#pong(token = nil) ⇒ Object



15
# File 'lib/iirc/modules/verbs.rb', line 15

def pong(token=nil) self << (token ? "PONG :#{token}" : "PONG") end

#quit(msg = 'Quitting') ⇒ Object



10
# File 'lib/iirc/modules/verbs.rb', line 10

def quit(msg='Quitting') self << "QUIT :#{msg}" end

#topic(channel, new_topic = '') ⇒ Object



20
# File 'lib/iirc/modules/verbs.rb', line 20

def topic(channel, new_topic='') self << (new_topic ? "TOPIC #{channel} :#{new_topic.lines.first.chomp}" : "TOPIC #{channel}") end

#wallops(msg) ⇒ Object



17
# File 'lib/iirc/modules/verbs.rb', line 17

def wallops(msg) for line in msg.to_s.lines; self << "WALLOPS :#{line.chomp}"; end; self end

#who(target) ⇒ Object



6
# File 'lib/iirc/modules/verbs.rb', line 6

def who(target) self << "WHO #{target}" end