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.



1121
1122
1123
1124
# File 'lib/rbot/irc.rb', line 1121

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

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



1120
1121
1122
# File 'lib/rbot/irc.rb', line 1120

def list
  @list
end

Instance Method Details

#reset(val) ⇒ Object



1131
1132
1133
1134
# File 'lib/rbot/irc.rb', line 1131

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

#set(val) ⇒ Object



1126
1127
1128
1129
# File 'lib/rbot/irc.rb', line 1126

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