Model for prototype model functionality.
module:models/AbstractModel
The AbstractModel class
Classes
Members
(inner) object
Property holding the wrapped object that is initialized in the child classes. Usually, the static get() method of the app.js module is used to obtain a model instance.
Methods
(inner) AbstractModel/__noSuchMethod__(methodName, methodArgs)
Fallback to use wrapped object's native functions in case method is not defined. The logic will try to invoke method for this.object, and throw TypeError if the method does not exist
Parameters:
Name | Type | Description |
---|---|---|
methodName |
String |
The name of a method to use as a fallback. |
methodArgs |
Array |
The arguments for the method. |
Throws:
Returns:
Record Result or exception if the method does not exist.
(abstract, inner) AbstractModel/get() → {Void}
Returns a wrapped object instance. This method needs to be implemented by the subclasses.
Returns:
- Type
- Void
(inner) AbstractModel/getValue(key) → {Object}
Gets value from prepopulated object. If the key is point-delimited, parses JSON If not, obtains a value from "custom" property of an object
Parameters:
Name | Type | Description |
---|---|---|
key |
String |
The JSON key to retrieve a value for. |
Returns:
- Type
- Object
(inner) AbstractModel/initProperties()
Creates property access and delegate it to the appropriate getters & setters of the wrapper or wrapped object
(inner) AbstractModel/setValue.() → {Boolean}
Sets value to prepopulated object. If the key is point-delimited, parses JSON and sets up a target value.
Returns:
true if value is successfully set.
- Type
- Boolean