#' @export
construct.R6ClassGenerator <- function(data, defn, ...) {
data %>%
select(constructor_args(defn$public_methods$initialize)) %>%
transpose() %>%
map(~exec(defn$new, !!!.))
}
#' @export
deconstruct.R6ClassGenerator <- function(objs, defn, ...) {
map_dfr(
objs,
function(obj, fields) {
map(fields, ~obj[[.]]) %>%
set_names(fields) %>%
as_tibble_row()
},
fields = unique(c(
names(defn$public_fields),
names(defn$active)
))
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.