BASE$..init.. {bandicoot}R Documentation

Initialization method

Description

This function will be called after an instance is built. User could override this function in derived class.

Usage

BASE$..init..(...)

Arguments

...

Ignored by BASE, but user can define their owns.

Value

Return the object itself.

Examples


BASE$..init..

# Inherit from BASE
TEST <- new_class(BASE, class_name = "TEST")

# Override the `..init..` method
register_method(TEST, ..init.. = function(a) {self$x <- a})

# Build a `TEST` instance
test <- TEST$instantiate(a = 2)

test$x

[Package bandicoot version 1.0.0 Index]