Skip to content

Commit f762159

Browse files
committed
fix missing input "signature" for set_obj_method
Now works correctly for chart and iterator objects.
1 parent 9dc1c90 commit f762159

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

R/struct_class.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ set_struct_obj = function(
285285
#' @param method_name the name of the method to update. Must be an existing method for the object.
286286
#' @param definition the function to replace the method with. This function will be used when the method is called on the object.
287287
#' @param where the environment to create the object in. default where = topenv(parent.frame())
288+
#' @param signature a list of classes that this object requires as inputs. Default is c(class_name,'DatasetExperiment')
288289
#' @return a method is created in the specified environment
289290
#' @examples
290291
#' set_struct_obj(
@@ -299,13 +300,13 @@ set_struct_obj = function(
299300
#' name = 'Add two inputs',
300301
#' description = 'example class that adds two values together')
301302
#')
302-
set_obj_method = function(class_name, method_name, definition, where = topenv(parent.frame())) {
303+
set_obj_method = function(class_name, method_name, definition, where = topenv(parent.frame()), signature=c(class_name,'DatasetExperiment')) {
303304

304-
setMethod(f = method_name,
305-
signature = c(class_name,'DatasetExperiment'),
305+
setMethod(f = method_name,
306+
signature = signature,
306307
definition = definition,
307-
where = where
308-
)
308+
where = where)
309+
309310
}
310311

311312
# ' update show method for a struct object

0 commit comments

Comments
 (0)