Class: Twitch::Chat::Channel
- Inherits:
-
Object
- Object
- Twitch::Chat::Channel
- Defined in:
- lib/twitch/chat/channel.rb
Instance Attribute Summary collapse
-
#moderators ⇒ Object
readonly
Returns the value of attribute moderators.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_moderator(moderator) ⇒ Object
-
#initialize(name) ⇒ Channel
constructor
A new instance of Channel.
- #remove_moderator(moderator) ⇒ Object
Constructor Details
#initialize(name) ⇒ Channel
Returns a new instance of Channel.
6 7 8 9 |
# File 'lib/twitch/chat/channel.rb', line 6 def initialize(name) @name = name @moderators = [] end |
Instance Attribute Details
#moderators ⇒ Object (readonly)
Returns the value of attribute moderators.
4 5 6 |
# File 'lib/twitch/chat/channel.rb', line 4 def moderators @moderators end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/twitch/chat/channel.rb', line 4 def name @name end |
Instance Method Details
#add_moderator(moderator) ⇒ Object
11 12 13 |
# File 'lib/twitch/chat/channel.rb', line 11 def add_moderator(moderator) @moderators << moderator end |
#remove_moderator(moderator) ⇒ Object
15 16 17 |
# File 'lib/twitch/chat/channel.rb', line 15 def remove_moderator(moderator) @moderators.delete(moderator) end |