Link Search Menu Expand Document

Object

Table of contents

  1. Object
    1. Object.getClassRef(String) -> Result<Object>
    2. Object.createFrom(String) -> Result<Object>
    3. Object.hash(Value) -> String

Object

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

import Object;

Object.getClassRef(String) -> Result<Object>

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) -> Result<Object>

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>

Object.hash(Value) -> String

This method will return a string of the object’s hash value.

NOTE Strings, Booleans, Nil will always return the same value since these values are interned.

Object.hash("Dictu");

This site uses Just The Docs, with modifications.