settings: Insight.js refactor 3

This commit is contained in:
Manuel Araoz 2014-09-03 15:09:06 -03:00
commit e3afce6a9f

View file

@ -29,15 +29,15 @@ var preconditions = require('preconditions').singleton();
*/
var Insight = function(opts) {
this.status = this.STATUS.DISCONNECTED;
this.subscribed = {};
this.listeningBlocks = false;
preconditions.checkArgument(opts).shouldBeObject(opts)
.checkArgument(opts.host)
.checkArgument(opts.port)
.checkArgument(opts.schema);
this.status = this.STATUS.DISCONNECTED;
this.subscribed = {};
this.listeningBlocks = false;
this.url = opts.schema + '://' + opts.host + ':' + opts.port;
this.opts = {
'reconnection': opts.reconnection || true,