Link Search Menu Expand Document

Object

Table of contents

  1. Object
    1. Object.getClassRef(string)
    2. Object.createFrom(string)

Object

To make use of the Object module an import is required.

import Object;

Object.getClassRef(string)

This method will attempt to get a class reference from the class name provided as a string.

Returns a Result and unwraps to an Object upon success.

NOTE: This currently only works if the class is defined in the global scope

class Test {}

Object.getClassRef("Test").unwrap(); // <Cls Test>

Object.createFrom(string)

This method will attempt to create a new object from the class name provided as a string.

Returns a Result and unwraps to an Object upon success.

NOTE: This currently only works if the class is defined in the global scope

class Test {}

Object.createFrom("Test").unwrap(); // <Test instance>

This site uses Just The Docs, with modifications.