Skip to content

Commit

Permalink
socket: added in
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 24, 2012
1 parent eb02138 commit e8d1192
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ Socket.prototype.emit = function(ev){
return this;
};

/**
* Targets a room when broadcasting.
*
* @param {String} name
* @return {Socket} self
* @api public
*/

Socket.prototype.to =
Socket.prototype.in = function(name){
this.rooms = this.rooms || [];
if (!~this.rooms.indexOf(name)) this.rooms.push(name);
return this;
};

/**
* Sends a `message` event.
*
Expand Down

0 comments on commit e8d1192

Please sign in to comment.