Class: Irc::Channel::ModeTypeA

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

Overview

Channel modes of type A manipulate lists

Example: b (banlist)

Instance Attribute Summary collapse

Attributes inherited from Mode

#channel

Instance Method Summary collapse

Constructor Details

#initialize(ch) ⇒ ModeTypeA

Returns a new instance of ModeTypeA.



1154
1155
1156
1157
# File 'lib/rbot/irc.rb', line 1154

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

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



1153
1154
1155
# File 'lib/rbot/irc.rb', line 1153

def list
  @list
end

Instance Method Details

#reset(val) ⇒ Object



1164
1165
1166
1167
# File 'lib/rbot/irc.rb', line 1164

def reset(val)
  nm = @channel.server.new_netmask(val)
  @list.delete(nm)
end

#set(val) ⇒ Object



1159
1160
1161
1162
# File 'lib/rbot/irc.rb', line 1159

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