Class: IRC::Server::Channel
Defined Under Namespace
Classes: Topic
Instance Attribute Summary collapse
-
#createdOn ⇒ Object
readonly
Returns the value of attribute createdOn.
-
#modes ⇒ Object
readonly
Returns the value of attribute modes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#topic ⇒ Object
Returns the value of attribute topic.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
Instance Method Summary collapse
- #[](user) ⇒ Object
- #add(user) ⇒ Object
- #delete(user) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(server, name) ⇒ Channel
constructor
A new instance of Channel.
- #send(*args) ⇒ Object
- #to_s ⇒ Object
- #user(client) ⇒ Object
Constructor Details
#initialize(server, name) ⇒ Channel
Returns a new instance of Channel.
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/failirc/server/channel.rb', line 63 def initialize (server, name) @server = server @name = name @type = name[0, 1] @createdOn = Time.now @users = Users.new(self) @modes = Modes.new @topic = Topic.new(self) @semaphore = Mutex.new end |
Instance Attribute Details
#createdOn ⇒ Object (readonly)
Returns the value of attribute createdOn.
61 62 63 |
# File 'lib/failirc/server/channel.rb', line 61 def createdOn @createdOn end |
#modes ⇒ Object (readonly)
Returns the value of attribute modes.
61 62 63 |
# File 'lib/failirc/server/channel.rb', line 61 def modes @modes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
61 62 63 |
# File 'lib/failirc/server/channel.rb', line 61 def name @name end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
61 62 63 |
# File 'lib/failirc/server/channel.rb', line 61 def server @server end |
#topic ⇒ Object
Returns the value of attribute topic.
61 62 63 |
# File 'lib/failirc/server/channel.rb', line 61 def topic @topic end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
61 62 63 |
# File 'lib/failirc/server/channel.rb', line 61 def type @type end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
61 62 63 |
# File 'lib/failirc/server/channel.rb', line 61 def users @users end |
Instance Method Details
#[](user) ⇒ Object
91 92 93 |
# File 'lib/failirc/server/channel.rb', line 91 def [] (user) users[user] end |
#add(user) ⇒ Object
95 96 97 |
# File 'lib/failirc/server/channel.rb', line 95 def add (user) users.add(user) end |
#delete(user) ⇒ Object
99 100 101 |
# File 'lib/failirc/server/channel.rb', line 99 def delete (user) users.delete(user) end |
#empty? ⇒ Boolean
107 108 109 |
# File 'lib/failirc/server/channel.rb', line 107 def empty? return @users.empty? end |
#send(*args) ⇒ Object
111 112 113 |
# File 'lib/failirc/server/channel.rb', line 111 def send (*args) users.send(*args) end |
#to_s ⇒ Object
115 116 117 |
# File 'lib/failirc/server/channel.rb', line 115 def to_s @name end |
#user(client) ⇒ Object
103 104 105 |
# File 'lib/failirc/server/channel.rb', line 103 def user (client) return @users[client.nick] end |