YUKI Hiroshi
null+****@clear*****
Thu Jan 9 12:26:46 JST 2014
YUKI Hiroshi 2014-01-09 12:26:46 +0900 (Thu, 09 Jan 2014) New Revision: cac651dc543289f56c525692a60594b1d52e0fff https://github.com/droonga/express-droonga/commit/cac651dc543289f56c525692a60594b1d52e0fff Message: Accept "name" option for command definitions Modified files: lib/adapter/command.js Modified: lib/adapter/command.js (+8 -0) =================================================================== --- lib/adapter/command.js 2014-01-09 12:23:49 +0900 (b35ecc4) +++ lib/adapter/command.js 2014-01-09 12:26:46 +0900 (e576600) @@ -18,6 +18,14 @@ Command.extend = function(targetClass) { Object.defineProperty(targetClass.prototype, 'dataset', { get: function() { return this._options.dataset; } }); + Object.defineProperty(targetClass.prototype, 'name', { + get: function() { + if (typeof this._name !== 'undefined') + return this._name; + return this._options.name || this._name; + }, + set: function(name) { return this._name = name; } + }); targetClass.isInstance = function(modelInstance) { return ( modelInstance && -------------- next part -------------- HTML����������������������������... Descargar