Skip to content

Class: Method

Represents a method definition within a class or object.

Example

ts
method exhaust() {
   energy -= 5
}

Constructors

Constructor

new Method(identifier, equations, loc?): Method

Parameters

ParameterType
identifierSymbolPrimitive
equationsEquation[]
loc?SourceLocation

Returns

Method

Overrides

ASTNode.constructor

Methods

getMetadata()

getMetadata<T>(key): T

Type Parameters

Type Parameter
T

Parameters

ParameterType
keystring

Returns

T

Inherited from

ASTNode.getMetadata


hasMetadata()

hasMetadata(key): boolean

Parameters

ParameterType
keystring

Returns

boolean

Inherited from

ASTNode.hasMetadata


setMetadata()

setMetadata(key, value): void

Parameters

ParameterType
keystring
valueany

Returns

void

Inherited from

ASTNode.setMetadata