Adds noop function to base adaptor.

This commit is contained in:
Edgar Silva 2014-07-02 19:42:39 -05:00
parent c4b10e66f4
commit afa7fe7495
1 changed files with 12 additions and 0 deletions

View File

@ -60,3 +60,15 @@ Adaptor.prototype.disconnect = function(callback) {
this.removeAllListeners();
callback();
};
// Public: Voids all command functions so they do not interact
// with anything after disconnect has been called.
//
// Returns nothing
Adaptor.prototype.noop = function() {
var fnVoid = (function(command) {
this[command] = function() {return null };
}).bind(this);
this.commands.forEach(fnVoid);
};