Simplify path for method proxying in drivers
This commit is contained in:
parent
280687099c
commit
13c388fbf7
|
@ -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
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue