5252# ' self$x
5353# ' }
5454# ' )
55- # ' is.ggproto (Adder)
55+ # ' is_ggproto (Adder)
5656# '
5757# ' Adder$add(10)
5858# ' Adder$add(10)
@@ -88,7 +88,7 @@ ggproto <- function(`_class` = NULL, `_inherit` = NULL, ...) {
8888
8989 super <- find_super()
9090 if (! is.null(super )) {
91- check_object(super , is.ggproto , " a {.cls ggproto} object" , arg = " _inherit" )
91+ check_object(super , is_ggproto , " a {.cls ggproto} object" , arg = " _inherit" )
9292 e $ super <- find_super
9393 class(e ) <- c(`_class` , class(super ))
9494 } else {
@@ -106,10 +106,17 @@ ggproto_parent <- function(parent, self) {
106106 structure(list (parent = parent , self = self ), class = " ggproto_parent" )
107107}
108108
109- # ' @param x An object to test.
110109# ' @export
111- # ' @rdname ggproto
112- is.ggproto <- function (x ) inherits(x , " ggproto" )
110+ # ' @rdname is_tests
111+ is_ggproto <- function (x ) inherits(x , " ggproto" )
112+
113+ # ' @export
114+ # ' @rdname is_tests
115+ # ' @usage is.ggproto(x) # Deprecated
116+ is.ggproto <- function (x ) {
117+ deprecate_soft0(" 3.5.2" , " is.ggproto()" , " is_ggproto()" )
118+ is_ggproto(x )
119+ }
113120
114121fetch_ggproto <- function (x , name ) {
115122 res <- NULL
@@ -305,7 +312,7 @@ object_summaries <- function(x, exclude = NULL, flat = TRUE) {
305312 values <- vapply(obj_names , function (name ) {
306313 obj <- x [[name ]]
307314 if (is.function(obj )) " function"
308- else if (is.ggproto (obj )) format(obj , flat = flat )
315+ else if (is_ggproto (obj )) format(obj , flat = flat )
309316 else if (is.environment(obj )) " environment"
310317 else if (is.null(obj )) " NULL"
311318 else if (is.atomic(obj )) trim(paste(as.character(obj ), collapse = " " ))
0 commit comments