nci/lib/command/base.js

24 lines
428 B
JavaScript
Raw Normal View History

2014-05-10 10:19:47 +00:00
'use strict';
var EventEmitter = require('events').EventEmitter,
inherits = require('util').inherits;
function Command(params) {
params = params || {};
2014-12-14 20:04:00 +00:00
this.emitOut = params.emitOut;
2014-05-10 10:19:47 +00:00
}
exports.Command = Command;
2014-05-10 10:19:47 +00:00
inherits(Command, EventEmitter);
Command.prototype.enableEmitter = function() {
2014-12-14 20:04:00 +00:00
this.emitOut = true;
2014-05-10 10:19:47 +00:00
return this;
};
Command.prototype.disableEmitter = function() {
2014-12-14 20:04:00 +00:00
this.emitOut = false;
2014-05-10 10:19:47 +00:00
return this;
};