Version: v0.7.1 - Beta.  We welcome contributors & feedback.

Object.zSetField

zSetField($fieldName, $value) -> self

Description

Set the given field to the given value.

Note: New fields can only be created in the new constructor method.

class MyClass {
    fn set($color) {
        @.xSetField('color', $color)
        print(@.color)
    }
}

//------ another file ------

$c = MyClass()

$c.zSetField('color', 'green', 'PRIVATE')

See Also