new Meta()
Object which holds whole configuration for Model.
- Source:
Properties:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
name |
String |
<optional> |
null | |
pluralName |
String |
<optional> |
null | |
properties |
Array |
<optional> |
[] | |
endpoints |
Array |
<optional> |
{} | |
relatedModels |
Array |
<optional> |
Example
var MyMeta = Meta({name: 'test'}); var MyModel = SomeModel.setMeta(MyMeta);
Methods
-
assignProperties(source, target)
-
Makes a copy of target and adds required properties from source.
Parameters:
Name Type Description source
Object target
Object - Source:
Returns:
- Type
- Object
-
findAllowedMethod(endpointName, methodNames)
-
Looks for the first allowed method from
methodNames
for selected endpoint.Parameters:
Name Type Argument Description endpointName
String methodNames
String <repeatable>
- Source:
Returns:
- Type
- String
-
getObjectProperties(object)
-
Gets required properties from object. Used mostly during serialization.
Parameters:
Name Type Description object
Object - Source:
Returns:
- Type
- Object
-
resolveEndpointPath(endpointName, properties)
-
Resolves endpoint path e.g:
/v1.1/instances/{name}/
will be converted to/v1.1/instances/someName/
.Parameters:
Name Type Description endpointName
String properties
Object - Source:
Returns:
- Type
- String