Simplify path for method proxying in drivers

This commit is contained in:
Andrew Stewart 2014-12-18 13:19:58 -08:00
parent 280687099c
commit 13c388fbf7
2 changed files with 2 additions and 8 deletions

View File

@ -30,13 +30,7 @@ Utils.subclass(Basestar, EventEmitter);
// force - whether or not to overwrite existing method definitions // force - whether or not to overwrite existing method definitions
// //
// Returns the klass where the methods have been proxied // Returns the klass where the methods have been proxied
Basestar.prototype.proxyMethods = function(methods, target, source, force) { Basestar.prototype.proxyMethods = Utils.proxyFunctionsToObject;
if (force == null) {
force = false;
}
return Utils.proxyFunctionsToObject(methods, target, source, force);
};
// Public: Defines an event handler that proxies events from a source object // Public: Defines an event handler that proxies events from a source object
// to a target object // to a target object

View File

@ -51,7 +51,7 @@ Driver.prototype.setupCommands = function(commands, proxy) {
proxy = this.connection; proxy = this.connection;
} }
this.proxyMethods(commands, proxy, this); Utils.proxyFunctionsToObject(commands, proxy, this);
_.forEach(commands, function(command) { _.forEach(commands, function(command) {
var snake_case = command.replace(/[A-Z]+/g, function(match) { var snake_case = command.replace(/[A-Z]+/g, function(match) {