hardlounge/lib/models/client.js

18 lines
313 B
JavaScript
Raw Normal View History

2014-06-23 17:28:36 +00:00
var _ = require("lodash");
module.exports = Client;
function Client(attr) {
_.merge(this, _.extend({
name: "",
networks: [],
sockets: null,
}, attr));
};
Client.prototype.emit = function(event, data) {
if (this.sockets != null) {
this.sockets.in(this.name).emit(event, data);
}
};