Skip to contents

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..()
#> 
#> ── <BASE object> 

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

TEST$..new..()
#> 
#> ── <TEST object>