R/object_utils.R

Defines functions validate_object_type

validate_object_type <- function(obj, obj_name){
  if(typeof(obj) != "environment"){
    stop("Object must be of type environment")
  }
  if(!all(class(obj) == c(obj_name, "R6"))){
    stop("Object must be of class ", obj_name, " not ", class(obj))
  }
}
CRI-iAtlas/iatlas.modules2 documentation built on Dec. 19, 2024, 8:14 p.m.