Learn R Programming

bandicoot (version 1.0.0)

BASE$..init..: Initialization method

Description

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

Usage

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

Value

Return the object itself.

Arguments

...

Ignored by BASE, but user can define their owns.

Examples

Run this code

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

Run the code above in your browser using DataLab