R/getName.R

Defines functions getName.smoof_wrapped_function getName.smoof_function getName

Documented in getName

#' Returns the name of the function.
#'
#' @template arg_smoof_function
#' @return [\code{character(1)}]
#'  The name of the function.
#' @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)))
}
jakobbossek/smoof documentation built on Feb. 17, 2024, 2:23 a.m.