R/getName.R

Defines functions getName.smoof_wrapped_function getName.smoof_function getName

Documented in getName

#' Return the name of the function.
#'
#' @template arg_smoof_function
#' @return [\code{character(1)}]
#' @export
getName = function(fn) {
  UseMethod("getName")
}

#' @export
getName.smoof_function = function(fn) {
  return(attr(fn, "name"))
}

#' @export
getName.smoof_wrapped_function = function(fn) {
  return(getName(getWrappedFunction(fn)))
}

Try the smoof package in your browser

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

smoof documentation built on March 31, 2023, 11:48 p.m.