Given an R6 class, build a Roxygen documentation skeleton describing its public interface.

document_class(aClass)

Arguments

aClass

An R6Class. Note that this should be the class generator, NOT an instance of that class.

Examples

# \donttest{ # Build a sample class LupeFiasco <- R6::R6Class( "LupeFiasco", public = list( initialize = function(food = TRUE, liquor = "interesting"){ return(food & liquor) }, kick_and_push = function(n = 10){ return(sample(c("kick", "push", "coast"), size = n, replace = TRUE)) }, did_you_say_lupe_frasco = function(response_type = "lie"){ switch(response_type, "lie" = "yes", "no") } ), active = list( they_call_me = function(){"lupe"}, ill_be_your = function(){"new day"} ) ) # Document it! cat(document_class(LupeFiasco))
#> #> #' @section Class Constructor: #> #' \describe{ #> #' \item{\code{new(food = TRUE, liquor = "interesting")}}{ #> #' \itemize{ #> #' \item{~~DESCRIBE THE METHOD~~} #> #' \item{\bold{Args:}}{ #> #' \itemize{ #> #' \item{\bold{\code{food}}: ~~DESCRIBE THIS PARAMETER~~ #> #' } #> #' \item{\bold{\code{liquor}}: ~~DESCRIBE THIS PARAMETER~~ #> #' } #> #' } #> #' } #> #' \item{\bold{Returns:}}{ #> #' \itemize{ #> #' \item{~~WHAT DOES THIS RETURN~~} #> #' } #> #' } #> #' } #> #' } #> #' } #> #' #> #' #> #' @section Public Methods: #> #' \describe{ #> #' \item{\code{kick_and_push(n = 10)}}{ #> #' \itemize{ #> #' \item{~~DESCRIBE THE METHOD~~} #> #' \item{\bold{Args:}}{ #> #' \itemize{ #> #' \item{\bold{\code{n}}: ~~DESCRIBE THIS PARAMETER~~ #> #' } #> #' } #> #' } #> #' \item{\bold{Returns:}}{ #> #' \itemize{ #> #' \item{~~WHAT DOES THIS RETURN~~} #> #' } #> #' } #> #' } #> #' } #> #' \item{\code{did_you_say_lupe_frasco(response_type = "lie")}}{ #> #' \itemize{ #> #' \item{~~DESCRIBE THE METHOD~~} #> #' \item{\bold{Args:}}{ #> #' \itemize{ #> #' \item{\bold{\code{response_type}}: ~~DESCRIBE THIS PARAMETER~~ #> #' } #> #' } #> #' } #> #' \item{\bold{Returns:}}{ #> #' \itemize{ #> #' \item{~~WHAT DOES THIS RETURN~~} #> #' } #> #' } #> #' } #> #' } #> #' } #> #' #> #' #> #' @section Public Fields: #> #' \describe{ #> #' \item{\bold{\code{they_call_me}}}{: ~~DESCRIBE THIS FIELD~~} #> #' \item{\bold{\code{ill_be_your}}}{: ~~DESCRIBE THIS FIELD~~} #> #' } #> #' #> #' #> #' @section Special Methods: #> #' \describe{ #> #' \item{\code{clone(deep = FALSE)}}{ #> #' \itemize{ #> #' \item{Method for copying an object. See \href{https://adv-r.hadley.nz/r6.html#r6-semantics}{emph{Advanced R}} for the intricacies of R6 reference semantics.} #> #' \item{\bold{Args:}}{ #> #' \itemize{ #> #' \item{\bold{\code{deep}}: logical. Whether to recursively clone nested R6 objects. #> #' } #> #' } #> #' } #> #' \item{\bold{Returns:}}{ #> #' \itemize{ #> #' \item{Cloned object of this class.} #> #' } #> #' } #> #' } #> #' } #> #' } #> #'
# }