Class: Eg::Book::Room
- Inherits:
-
Object
- Object
- Eg::Book::Room
- Defined in:
- lib/eg/book/chat_server_actions.rb
Instance Method Summary collapse
- #add(user) ⇒ Object
-
#initialize(room_name, owner, chat) ⇒ Room
constructor
A new instance of Room.
- #occupant_count ⇒ Object
Constructor Details
#initialize(room_name, owner, chat) ⇒ Room
Returns a new instance of Room.
70 71 72 73 74 75 |
# File 'lib/eg/book/chat_server_actions.rb', line 70 def initialize room_name, owner, chat @name = room_name @owner = owner @chat = chat @users = Set.new end |
Instance Method Details
#add(user) ⇒ Object
76 77 78 |
# File 'lib/eg/book/chat_server_actions.rb', line 76 def add user @users.add user end |
#occupant_count ⇒ Object
79 80 81 |
# File 'lib/eg/book/chat_server_actions.rb', line 79 def occupant_count @users.size end |