JsonOptions: R6 Class defining options available to config JSONs.

Description Super class Methods Examples

Description

This inherits from ReadableJsonOptions, but allows for adding (but not removing) options after initialisation.

Each of these generic functions/R6Classes can internally accept/access more specific config options.

Caution!!! The initialisation infers a names from the list being passed in, which means that it should be a list of variables that refer to the functions/R6Classes, i.e. NOT contain any anonymous functions/R6Classes. This is similar for 'add_' functions, except these accept ... rather than a list. So every argument (except overwrite keyword arg) being passed to an 'add_' function should be a variable referring to a function/R6Class (again NO anonymous functions/R6Classes). See examples below :)

Super class

portalLite::ReadableJsonOptions -> JsonOptions

Methods

Public methods

Inherited methods

Method add_data_service_functions()

Add to list of available data service functions.

Usage
JsonOptions$add_data_service_functions(..., .overwrite = FALSE)
Arguments
...

Functions to be added.

.overwrite

Overwrite existing functions when new name clashes?


Method add_data_types()

Add to list of available data types.

Usage
JsonOptions$add_data_types(..., .overwrite = FALSE)
Arguments
...

R6 Classes to be added.

.overwrite

Overwrite existing functions when new name clashes?


Method add_load_functions()

Add to list of available load functions.

Usage
JsonOptions$add_load_functions(..., .overwrite = FALSE)
Arguments
...

Functions to be added.

.overwrite

Overwrite existing functions when new name clashes?


Method add_plot_functions()

Add to list of available data service functions.

Usage
JsonOptions$add_plot_functions(..., .overwrite = FALSE)
Arguments
...

Functions to be added.

.overwrite

Overwrite existing functions when new name clashes?

Generic handler to write to different JsonOptions fields. Determines whether the object being added to one of the JsonOptions fields is valid. Will stop in case of anonymous functions/R6Classes. Return TRUE if any warnings thrown, FALSE otherwise.


Method clone()

The objects of this class are cloneable with this method.

Usage
JsonOptions$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
6
7
dummy_options <- JsonOptions(
  data_service_function = list(api_fetch1)

)
dummy_options
#> Configuration data/viz JSON options:
#>   Data service functions:

xaviermiles/portalLite documentation built on Jan. 28, 2022, 9:10 a.m.