Class: IRC::Client::Channel
Defined Under Namespace
Classes: Topic
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#createdOn ⇒ Object
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
readonly
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.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/failirc/client/channel.rb', line 51 def initialize (server, name) @client = server.client @server = server @name = name @type = name[0, 1] @createdOn = Time.now @users = Users.new(self) @modes = Modes.new @topic = Topic.new(self) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
48 49 50 |
# File 'lib/failirc/client/channel.rb', line 48 def client @client end |
#createdOn ⇒ Object
Returns the value of attribute createdOn.
49 50 51 |
# File 'lib/failirc/client/channel.rb', line 49 def createdOn @createdOn end |
#modes ⇒ Object (readonly)
Returns the value of attribute modes.
48 49 50 |
# File 'lib/failirc/client/channel.rb', line 48 def modes @modes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
48 49 50 |
# File 'lib/failirc/client/channel.rb', line 48 def name @name end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
48 49 50 |
# File 'lib/failirc/client/channel.rb', line 48 def server @server end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
48 49 50 |
# File 'lib/failirc/client/channel.rb', line 48 def topic @topic end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
48 49 50 |
# File 'lib/failirc/client/channel.rb', line 48 def type @type end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
48 49 50 |
# File 'lib/failirc/client/channel.rb', line 48 def users @users end |
Instance Method Details
#[](user) ⇒ Object
67 68 69 |
# File 'lib/failirc/client/channel.rb', line 67 def [] (user) users[user] end |
#add(user) ⇒ Object
71 72 73 |
# File 'lib/failirc/client/channel.rb', line 71 def add (user) users.add(user) end |
#delete(user) ⇒ Object
75 76 77 |
# File 'lib/failirc/client/channel.rb', line 75 def delete (user) users.delete(user) end |
#empty? ⇒ Boolean
83 84 85 |
# File 'lib/failirc/client/channel.rb', line 83 def empty? return @users.empty? end |
#send(*args) ⇒ Object
87 88 89 |
# File 'lib/failirc/client/channel.rb', line 87 def send (*args) users.send(*args) end |
#to_s ⇒ Object
91 92 93 |
# File 'lib/failirc/client/channel.rb', line 91 def to_s @name end |
#user(client) ⇒ Object
79 80 81 |
# File 'lib/failirc/client/channel.rb', line 79 def user (client) return @users[client.nick] end |