-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
test case
GIVEN a domain (showroom), a value object name (car) and a data.frame (mtcars)
WHEN add_value_object(path = "./R, domain = "showroom", name = "car", fields = "mtcars") is called
THE a new file is created ./R/showroom-value-objects
AND a value object template for car is created with mtcars columns as input arguments and expected types.
value object template
#' @title Car Value Object
#' @param mpg ('numeric') ?
#' @param hp ('numeric') ?
#' @return (`Car`) Car Value Object
#' @export
#' @family,
#' ...
#' examples Car()
Car <- function(
mpg = NA_real,
hp = NA_real,
cyl = NA_real
) return(
tibble::tibble(mpg = as.numeric(mpg))
|> tibble::add_column(hp = as.numeric(hp))
|> tibble::add_column(cyl = as.numeric(cyl))
|> dplyr::distinct()
|> tidyr::drop_na()
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels