Method new()
Initialization method sets given attributes individually and/or from a list.
Usage
GenericModel$new(
model_attributes = NULL,
attribute_aliases = NULL,
params = list(),
...
)
Arguments
model_attributes
A vector of model attribute names.
attribute_aliases
A list of alternative alias names for model attributes (form: alias = "attribute"
) to be used with the set and get attributes methods.
params
Parameters passed via a list.
...
Parameters passed individually.
Method new_clone()
Creates a new (re-initialized) object of the current (inherited) object class with optionally passed parameters.
Usage
GenericModel$new_clone(...)
Arguments
...
Parameters passed via the inherited class constructor (defined in initialize and run via new).
Returns
New object of the current (inherited) class.
Method get_attribute_names()
Returns an array of all attribute names including public and private model attributes, as well as attached attributes, error and warning messages.
Usage
GenericModel$get_attribute_names()
Returns
Array of all attribute names.
Method get_attributes()
Returns a list of values for selected attributes or attribute aliases (when array of parameter names provided) or all attributes (when no params).
Usage
GenericModel$get_attributes(params = NULL)
Arguments
params
Array of attribute names to return (all when NULL).
Returns
List of selected or all attributes values.
Method get_attribute()
Returns the value of an attribute via character name or attribute alias.
Usage
GenericModel$get_attribute(param)
Arguments
param
Character string name of the attribute.
Method get_attribute_aliases()
Returns an array of attribute names and aliases for specified or all attributes.
Usage
GenericModel$get_attribute_aliases(params = NULL)
Arguments
params
Array of attribute names for names/aliases to return (all when NULL).
Returns
Array of selected or all attribute names and aliases.
Method set_attributes()
Sets given attributes (optionally via alias names) individually and/or from a list.
Usage
GenericModel$set_attributes(params = list(), ...)
Arguments
params
List of parameters/attributes.
...
Parameters/attributes passed individually.
Method clone()
The objects of this class are cloneable with this method.
Usage
GenericModel$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.