enum: Create an enum S7 property

View source: R/03_S7_properties.R

enumR Documentation

Create an enum S7 property

Description

Returns a new_property() for a character scalar constrained to a fixed set of allowed values.

Usage

enum(values, default = NULL, nullable = FALSE)

Arguments

values

Character: Allowed values.

default

Optional Character: Default value.

nullable

Logical scalar. If TRUE, NULL is also accepted. Default FALSE.

Value

An S7 property object.

Author(s)

EDG

Examples

type_prop <- enum(c("string", "number", "boolean"), default = "string")

rtemis.core documentation built on Sept. 20, 2026, 9:06 a.m.