Skip to content

Commit

Permalink
Comments on Room methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Baclet committed Jun 11, 2015
1 parent f7e7c07 commit 1a5b6d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions index.js
Expand Up @@ -210,13 +210,27 @@ function Room(){
this.length = 0;
}

/**
* Adds a socket to a room.
*
* @param {String} socket id
* @api private
*/

Room.prototype.add = function(id){
if (!this.sockets.hasOwnProperty(id)) {
this.sockets[id] = true;
this.length++;
}
};

/**
* Removes a socket from a room.
*
* @param {String} socket id
* @api private
*/

Room.prototype.del = function(id){
if (this.sockets.hasOwnProperty(id)) {
delete this.sockets[id];
Expand Down

0 comments on commit 1a5b6d4

Please sign in to comment.