Class: Resource

Resource(definition)

Generic interface for collections of digital objects.

Constructor

new Resource(definition)

Parameters:
Name Type Description
definition Object Initial parameters
Source:

Methods

create(obj) → {Vector}

Create an instance of the Resource's type.
Parameters:
Name Type Description
obj Object Map of the instance's properties and values.
Source:
Returns:
Resulting Vector with deterministic identifier.
Type
Vector

trust(store) → {Resource}

Trust a datastore.
Parameters:
Name Type Description
store Store Instance to trust.
Source:
Returns:
Bound instance of the Resource.
Type
Resource

update(id, update) → {Vector}

Modify an existing instance of a Resource by its unique identifier. Produces a new instance.
Parameters:
Name Type Description
id String Unique ID to update.
update Object Map of change to make (keys -> values).
Source:
Returns:
Resulting Vector instance with updated identifier.
Type
Vector