Allow easier extension in subclasses w/ prototypes

This commit is contained in:
Andrew Stewart 2014-06-10 14:18:35 -07:00
parent bdf3c24388
commit 8d3c89076d
2 changed files with 4 additions and 2 deletions

View File

@ -32,11 +32,12 @@ module.exports = Adaptor = function Adaptor(opts) {
this.self = this; this.self = this;
this.name = opts.name; this.name = opts.name;
this.connection = opts.connection; this.connection = opts.connection;
this.commands = [];
}; };
Utils.subclass(Adaptor, Basestar); Utils.subclass(Adaptor, Basestar);
Adaptor.prototype.commands = [];
// Public: Connects to the adaptor, and triggers the provided callback when // Public: Connects to the adaptor, and triggers the provided callback when
// done. // done.
// //

View File

@ -33,11 +33,12 @@ module.exports = Driver = function Driver(opts) {
this.name = opts.name; this.name = opts.name;
this.device = opts.device; this.device = opts.device;
this.connection = this.device.connection; this.connection = this.device.connection;
this.commands = [];
}; };
Utils.subclass(Driver, Basestar); Utils.subclass(Driver, Basestar);
Driver.prototype.commands = [];
// Public: Starts up the driver, and triggers the provided callback when done. // Public: Starts up the driver, and triggers the provided callback when done.
// //
// callback - function to run when the driver is started // callback - function to run when the driver is started