This function makes a copy of the function, then set the evaluation environment to the container of the object environment.
Arguments
- env
Environment. Object.
- fn
Function. Method.
- container_name
Character. Name of the container.
Examples
TEST <- new_class(class_name = "TEST")
register_method(TEST, ..str.. = function() "test")
test <- TEST$instantiate(dist = "uniform", prm = list(a = 1, b = 2))
test$..str..()
#> [1] "test"
# Use method `..str..` from BASE class
use_method(test, BASE$..str..)()
#> [1] "<TEST object>"