diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-05 23:11:41 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-05 23:11:41 +0000 |
commit | 6ff355d5d40e165b3e2992d30b54f5684d07f5d2 (patch) | |
tree | d46b854d370d964b8f21280861ca4197c94d77d4 | |
parent | 7708c337a6e3e4ba858249c896e4ee6928995df2 (diff) |
New IRC Framework: add missing accessors for channel modes
-rw-r--r-- | lib/rbot/irc.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/rbot/irc.rb b/lib/rbot/irc.rb index 0cf70d5a..e6262522 100644 --- a/lib/rbot/irc.rb +++ b/lib/rbot/irc.rb @@ -854,6 +854,7 @@ module Irc # Mode on a Channel
#
class Mode
+ attr_reader :channel
def initialize(ch)
@channel = ch
end
@@ -866,6 +867,7 @@ module Irc # Example: b (banlist)
#
class ModeTypeA < Mode
+ attr_reader :list
def initialize(ch)
super
@list = NetmaskList.new
@@ -894,6 +896,11 @@ module Irc @arg = nil
end
+ def status
+ @arg
+ end
+ alias :value :status
+
def set(val)
@arg = val
end
@@ -911,6 +918,8 @@ module Irc # modes of type A
#
class UserMode < ModeTypeB
+ attr_reader :list
+ alias :users :list
def initialize(ch)
super
@list = UserList.new
@@ -937,19 +946,20 @@ module Irc class ModeTypeC < Mode
def initialize(ch)
super
- @arg = false
+ @arg = nil
end
def status
@arg
end
+ alias :value :status
def set(val)
@arg = val
end
def reset
- @arg = false
+ @arg = nil
end
end
|