Class: Top

Top(isCore)

new Top(isCore)

Base class for all Heta platform objects.

Parameters:
Name Type Description
isCore boolean

Marks the object as read-only.

Properties:
Name Type Description
id string

Object identifier.

index string

Object index used in diagnostics.

isCore boolean

true for read-only core objects.

Methods

getProperty(path) → {*}

Reads a nested property by path.

Parameters:
Name Type Description
path string

Property path, for example assignments.start_.

Returns:

Property value.

Type
*

instanceOf(className) → {boolean}

Checks class inheritance by Heta class name.

Parameters:
Name Type Description
className string

Heta class name.

Returns:

true if this object is an instance of the class.

Type
boolean

merge(q) → {Top}

Merges a Q-object into this object after schema validation.

Parameters:
Name Type Description
q object

Q-object fragment.

Returns:

This object.

Type
Top

setProperty(path, value) → {*}

Writes a nested property by path.

Parameters:
Name Type Description
path string

Property path.

value *

Value to set.

Returns:

Assigned value.

Type
*

toFlat(options) → {object}

Converts this object to flat Q-object format.

Parameters:
Name Type Description
options object

Serialization options.

Returns:

Flat object representation.

Type
object

toQ(options) → {object}

Converts this object to Q-object format.

Parameters:
Name Type Description
options object

Serialization options.

Returns:

Q-object representation.

Type
object

(static) isValid(q, logger) → {boolean}

Checks whether a Q-object satisfies this class schema.

Parameters:
Name Type Description
q object

Q-object fragment.

logger Logger

Logger used for validation errors.

Returns:

true when the object is valid.

Type
boolean