inst/silverstein/R/Carrots.R

# R6 Class Definitions for testing

#' @title Carrots
#' @name Carrots
#' @family Carrots
#' @description Class in which every method has an equal number of package function references
#' @importFrom R6 R6Class
#' @export
Carrots  <- R6Class(
  classname = "Carrots",

  # necessary to guarantee all class methods have precisely one reference
  cloneable = FALSE,

  public = list(
    initialize = function() {
      couplet_1()
    }
  ),
  private = list(
    finalize = function() {
      couplet_2()
    }
  )
)

couplet_1 <- function() {
  cat("They say that carrots are good for your eyes,\nThey swear that they improve your sight,\n")
}

couplet_2 <- function() {
  cat("But I'm seein' worse than I did last night--\nYou think maybe I aint usin' 'em right?\n")
}

Try the pkgnet package in your browser

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

pkgnet documentation built on Dec. 23, 2021, 9:07 a.m.