Constructor
new Scribe(config)
The "Scribe" is a simple tag-based recordkeeper.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
config |
Object | General configuration object.
Properties
|
Properties:
Name | Type | Description |
---|---|---|
config |
Object | Current configuration. |
- Source:
Extends
Methods
commit()
Increment the vector clock, broadcast all changes as a transaction.
- Overrides:
- Source:
deserialize(input) → {State}
Take a hex-encoded input and convert to a State object.
Parameters:
Name | Type | Description |
---|---|---|
input |
String | [description] |
- Overrides:
- Source:
Returns:
[description]
- Type
- State
fork() → {State}
- Overrides:
- Source:
Returns:
- Type
- State
get(path) → {Mixed}
Retrieve a key from the State.
Parameters:
Name | Type | Description |
---|---|---|
path |
Path | Key to retrieve. |
- Overrides:
- Source:
Returns:
- Type
- Mixed
inherits(scribe) → {Scribe}
Use an existing Scribe instance as a parent.
Parameters:
Name | Type | Description |
---|---|---|
scribe |
Scribe | Instance of Scribe to use as parent. |
- Source:
Returns:
The configured instance of the Scribe.
- Type
- Scribe
now() → {Number}
Retrives the current timestamp, in milliseconds.
- Source:
Returns:
Number representation of the millisecond Integer value.
- Type
- Number
render() → {String}
Compose a JSON string for network consumption.
- Overrides:
- Source:
Returns:
JSON-encoded String.
- Type
- String
serialize(inputopt) → {Buffer}
Convert to Buffer.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
input |
Mixed |
<optional> |
Input to serialize. |
- Overrides:
- Source:
Returns:
Store-able blob.
- Type
- Buffer
set(path) → {Mixed}
Set a key in the State to a particular value.
Parameters:
Name | Type | Description |
---|---|---|
path |
Path | Key to retrieve. |
- Overrides:
- Source:
Returns:
- Type
- Mixed
toHTML()
Converts the State to an HTML document.
- Overrides:
- Source:
toString() → {String}
Unmarshall an existing state to an instance of a Blob.
- Overrides:
- Source:
Returns:
Serialized Blob.
- Type
- String
trust(source) → {Scribe}
Blindly bind event handlers to the Source.
Parameters:
Name | Type | Description |
---|---|---|
source |
Source | Event stream. |
- Source:
Returns:
Instance of the Scribe.
- Type
- Scribe