R/R6-Result.R

Defines functions as.character.Result format.Result

for_onload(function() {

Result <- R6Class(
  "Result",
  public = list(
    error_list = NULL,
    data = NULL,
    as_json = function(...) {
      result_as_json(self, ...)
    },
    initialize = function(error_list = ErrorList$new()) {
      self$error_list <- error_list
      self$data <- NULL
      invisible(self)
    },
    print = function(...) {
      print(self$as_json(...))
    }
  )
)

}) # end for_onload

format.Result <- function(x, ...) {
  as.character(x$as_json(...))
}
as.character.Result <- function(x, ...) {
  as.character(x$as_json(...))
}
schloerke/graphqlr documentation built on Dec. 7, 2022, 10:57 a.m.