hardlounge/lib/models/client.js
2014-06-23 19:28:49 +02:00

18 lines
313 B
JavaScript

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);
}
};