R/vctrs.R

Defines functions vec_cast.character.glue vec_cast.glue.character vec_cast.glue.glue vec_ptype2.character.glue vec_ptype2.glue.character vec_ptype2.glue.glue

#' @exportS3Method vctrs::vec_ptype2
vec_ptype2.glue.glue <- function(x, y, ...) {
  x
}
#' @exportS3Method vctrs::vec_ptype2
vec_ptype2.glue.character <- function(x, y, ...) {
  x
}
#' @exportS3Method vctrs::vec_ptype2
vec_ptype2.character.glue <- function(x, y, ...) {
  y
}

# Note order of class is the opposite as for ptype2
#' @exportS3Method vctrs::vec_cast
vec_cast.glue.glue <- function(x, to, ...) {
  x
}
#' @exportS3Method vctrs::vec_cast
vec_cast.glue.character <- function(x, to, ...) {
  as_glue(x)
}
#' @exportS3Method vctrs::vec_cast
vec_cast.character.glue <- function(x, to, ...) {
  unclass(x)
}
tidyverse/glue documentation built on Sept. 19, 2024, 3:06 a.m.