Constructor
new BucketPrefix(model)
Parameters:
| Name | Type | Description |
|---|---|---|
model | Model | Model instance. |
- Source
Example
const prefix = new BucketPrefix(modelFoo);Methods
getParam(pos) → {String}
Return path parameter for a given position.
Example: Bucket Prefix /foo/bar/biz/baz Position | 1 | 2 | 3 | 4
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
pos | Number | 1 | Bucket Prefix position (default: 1). |
- Source
Returns:
- Type:
- String
Example
const param = prefix.getParam(2);
// barlastParam() → {String}
Return path last parameter.
- Source
Returns:
- Type:
- String
Example
const param = prefix.lastParam();
// bazparams() → {Array.<String>}
Return array of path parameters (ordered by index).
- Source
Returns:
- Type:
- Array.<String>
Example
const params = prefix.params();
// ['foo', 'bar', 'biz', 'baz']path() → {String}
Return path relative to Model position.
- Source
Returns:
- Type:
- String
Example
const param = prefix.path();
// foo/bar/biz/bazrootParam() → {String}
Return path root parameter.
- Source
Returns:
- Type:
- String
Example
const param = prefix.rootParam();
// foo