Plato on Github
Report Home
src/define/build.js
Maintainability
76.49
Lines of code
56
Difficulty
8.14
Estimated Errors
0.11
Function weight
By Complexity
By SLOC
/** * @file Build entity * @since 0.1.6 */ /*#ifndef(UMD)*/ "use strict"; /*global _GpfEntityDefinition*/ // Entity definition /*global _gpfContext*/ // Resolve contextual string /*global _gpfDefineEntitiesAdd*/ // Store the entity definition to be retreived later /*global _gpfEmptyFunc*/ // An empty function /*#endif*/ Object.assign(_GpfEntityDefinition.prototype, { /** * Instance builder function (a.k.a. public constructor) * * @type {Function} * @since 0.1.6 */ _instanceBuilder: null, /** * @gpf:read _instanceBuilder * @since 0.1.6 */ getInstanceBuilder: function () { /* istanbul ignore else */ // define.build.1 if (!this._instanceBuilder) { this._setInstanceBuilder(this._build()); } return this._instanceBuilder; }, /** * @gpf:write _instanceBuilder * @since 0.1.6 */ _setInstanceBuilder: function (value) { if (this._namespace) { _gpfContext(this._namespace.split("."), true)[this._name] = value; } this._instanceBuilder = value; _gpfDefineEntitiesAdd(this); }, /** * Process initial definition and generate instance builder function * * @return {Function} Instance builder function * @protected * @since 0.1.6 */ _build: _gpfEmptyFunc });