BASE-cash-..new..: Build a new instance from a class or an instance

BASE$..new..R Documentation

Build a new instance from a class or an instance

Description

This function will copy all methods and attributes, except the container, and the instantiate method. Then, the ..init_call.. attribute will be set to the current system call, and the ..instantiated.. attribute will be set to TRUE. Notice, the ..init.. method will not run.

Usage

BASE$..new..(env = new.env(parent = parent.frame()), init_call = sys.call())

Arguments

env

Environment. The instance environment.

init_call

Call. Contents of the ..init_call... It is recommended to leave it as default.

Value

An instance environment.

Examples


BASE$..new..()

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

TEST$..new..()

bandicoot documentation built on May 29, 2024, 8:01 a.m.