Class: Irc::Channel::UserMode

Inherits:
ModeTypeB show all
Defined in:
lib/rbot/irc.rb

Overview

Channel modes that change the User prefixes are like Channel modes of type B, except that they manipulate lists of Users, so they are somewhat similar to channel modes of type A

Instance Attribute Summary collapse

Attributes inherited from Mode

#channel

Instance Method Summary collapse

Methods inherited from ModeTypeB

#status

Constructor Details

#initialize(ch) ⇒ UserMode

Returns a new instance of UserMode.



1173
1174
1175
1176
# File 'lib/rbot/irc.rb', line 1173

def initialize(ch)
  super
  @list = UserList.new
end

Instance Attribute Details

#listObject (readonly) Also known as: users

Returns the value of attribute list.



1171
1172
1173
# File 'lib/rbot/irc.rb', line 1171

def list
  @list
end

Instance Method Details

#reset(val) ⇒ Object



1183
1184
1185
1186
# File 'lib/rbot/irc.rb', line 1183

def reset(val)
  u = @channel.server.user(val)
  @list.delete(u)
end

#set(val) ⇒ Object



1178
1179
1180
1181
# File 'lib/rbot/irc.rb', line 1178

def set(val)
  u = @channel.server.user(val)
  @list << u unless @list.include?(u)
end