R/extractEnvObjectInformation.R

Defines functions extractEnvObjectInformation

extractEnvObjectInformation <- function(object_o_1) {
  on <- getObjectClassKind(object_o_1)
  stopifnot(on == 'environment')

  getPublicFields <- function() {
    l <- ls(object_o_1)
    f <- sapply(l, function(e) !typeof(object_o_1[[e]]) %in% c('closure'))
    generatePublicFieldParagraph(object_o_1, l[f])
  }

  getPublicMethods <- function() {
    methods <- getObjectFunctionNames(object_o_1)
    if (is.null(methods) || length(methods) == 0) return(NULL)
    generatePublicMethodParagraph(object_o_1, methods)
  }

  l <- list(
    'Environment fields' = getPublicFields(),
    'Environment methods' = getPublicMethods()
  )

  Filter(Negate(is.null), l)
}

Try the wyz.code.rdoc package in your browser

Any scripts or data that you put into this service are public.

wyz.code.rdoc documentation built on Oct. 6, 2021, 9:07 a.m.