Skip to contents

This function is exported so that developers can add their own props in new packages, without needing to re-implement the prop and script classes themselves. It is not expected that end users will need this function.

Usage

add_prop(script, prop, exec = TRUE)

Arguments

script

A script object (from make_script) to append the prop to.

prop

A unifir_prop object (from unifir_prop) to add to the script.

exec

Logical: Should the method created by the prop be called in the MainFunc method?

Examples

script <- make_script("example_script", unity = waiver())
prop <- unifir_prop(
  prop_file = waiver(), # Must be a file that exists or waiver()
  method_name = NULL, # Auto-generated if NULL or NA
  method_type = "ExampleProp", # Length-1 character vector
  parameters = list(), # Not validated, usually a list
  build = function(script, prop, debug) {},
  using = character(0)
)
script <- add_prop(script, prop)