Class: Irc::Channel::UserMode
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)
-
- (Object) list
(also: #users)
readonly
Returns the value of attribute list.
Attributes inherited from Mode
Instance Method Summary (collapse)
-
- (UserMode) initialize(ch)
constructor
A new instance of UserMode.
- - (Object) reset(val)
- - (Object) set(val)
Methods inherited from ModeTypeB
Constructor Details
- (UserMode) initialize(ch)
Returns a new instance of UserMode
1206 1207 1208 1209 |
# File '/home/apoc/projects/ruby/rbot/lib/rbot/irc.rb', line 1206 def initialize(ch) super @list = UserList.new end |
Instance Attribute Details
- (Object) list (readonly) Also known as: users
Returns the value of attribute list
1204 1205 1206 |
# File '/home/apoc/projects/ruby/rbot/lib/rbot/irc.rb', line 1204 def list @list end |
Instance Method Details
- (Object) reset(val)
1216 1217 1218 1219 |
# File '/home/apoc/projects/ruby/rbot/lib/rbot/irc.rb', line 1216 def reset(val) u = @channel.server.user(val) @list.delete(u) end |
- (Object) set(val)
1211 1212 1213 1214 |
# File '/home/apoc/projects/ruby/rbot/lib/rbot/irc.rb', line 1211 def set(val) u = @channel.server.user(val) @list << u unless @list.include?(u) end |