Extract: Extract or Replace Parts of a Class or Instance

ExtractR Documentation

Extract or Replace Parts of a Class or Instance

Description

Operators acting on oClass generators and their instances.

Usage

## S3 method for class 'ClassGenerator'
x$name

## S3 method for class 'ClassGenerator'
x[[i, exact = TRUE, inherits = TRUE]]

## S3 replacement method for class 'ClassGenerator'
x$name <- value

## S3 replacement method for class 'ClassGenerator'
x[[name]] <- value

## S3 method for class 'Instance'
x$name

## S3 method for class 'Instance'
x[[i, exact = TRUE, inherits = TRUE]]

Arguments

x

object of class "Instance" or "ClassGenerator"

i, name

character or symbol for `$` describing field name to return or set

exact

logical controlling whether a partial match is acceptable. Defaults to TRUE for no partial matching

inherits

logical describing whether parent environments should be searched

value

new field value

Details

For oClass instances, `$` and `[` first search the instance environment for the object. If no object is found, then all inherited objects are searched in order. Any object assigned to the instance will be inserted into the instance's environment. These operators act on the underlying Class template environment when applied to a Class generator.

Value

Environment of class "Instance" or function of class "ClassGenerator"


oops documentation built on March 18, 2022, 5:16 p.m.