Skip to content

Commit 94842d8

Browse files
No examples for validate_property if not exported.
1 parent b977d43 commit 94842d8

File tree

9 files changed

+1
-85
lines changed

9 files changed

+1
-85
lines changed

R/enum.R

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ enum <- function(...) {
6262
#' @return No return value, called for side effects.
6363
#' Prints a string representation of the enum object to the console.
6464
#' @export
65-
#'
66-
#' @examples
67-
#' Colors <- enum("red", "green", "blue")
68-
#' my_color <- Colors("red")
69-
#' print(my_color) # Output: Enum: red
7065
print.enum <- function(x, ...) {
7166
cat("Enum:", x$value, "\n")
7267
}
@@ -80,14 +75,6 @@ print.enum <- function(x, ...) {
8075
#' @param e2 Second enum object or a character value
8176
#' @return Logical value indicating whether the two objects are equal
8277
#' @export
83-
#'
84-
#' @examples
85-
#' Colors <- enum("red", "green", "blue")
86-
#' color1 <- Colors("red")
87-
#' color2 <- Colors("blue")
88-
#' color1 == color2 # FALSE
89-
#' color1 == Colors("red") # TRUE
90-
#' color1 == "red" # TRUE
9178
`==.enum` <- function(e1, e2) {
9279
if (inherits(e2, "enum")) {
9380
e1$value == e2$value
@@ -105,11 +92,6 @@ print.enum <- function(x, ...) {
10592
#' @param name The name of the field to access (should be "value")
10693
#' @return The value of the enum object
10794
#' @export
108-
#'
109-
#' @examples
110-
#' Colors <- enum("red", "green", "blue")
111-
#' my_color <- Colors("red")
112-
#' my_color$value # "red"
11395
`$.enum` <- function(x, name) {
11496
if (name == "value") {
11597
x[["value"]]
@@ -128,12 +110,6 @@ print.enum <- function(x, ...) {
128110
#' @param value The new value to set
129111
#' @return The updated enum object
130112
#' @export
131-
#'
132-
#' @examples
133-
#' Colors <- enum("red", "green", "blue")
134-
#' my_color <- Colors("red")
135-
#' my_color$value <- "blue" # Valid assignment
136-
#' try(my_color$value <- "yellow") # This will raise an error
137113
`$<-.enum` <- function(x, name, value) {
138114
if (name != "value") {
139115
stop("Cannot add new fields to an enum")
@@ -155,10 +131,6 @@ print.enum <- function(x, ...) {
155131
#' @return No return value, called for side effects.
156132
#' Prints a string representation of the enum generator to the console.
157133
#' @export
158-
#'
159-
#' @examples
160-
#' Colors <- enum("red", "green", "blue")
161-
#' print(Colors) # Output: Enum generator: red, green, blue
162134
print.enum_generator <- function(x, ...) {
163135
cat("Enum generator:", paste(attr(x, "values"), collapse = ", "), "\n")
164136
}

R/fun.R

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,6 @@ fun <- function(...) {
119119
#' Prints a human-readable representation of the typed function to the console,
120120
#' showing the argument types and return type.
121121
#' @export
122-
#' @examples
123-
#' # Define a typed function
124-
#' multiply <- fun(
125-
#' x = numeric,
126-
#' y = numeric,
127-
#' return = numeric,
128-
#' impl = function(x, y) {
129-
#' return(x * y)
130-
#' }
131-
#' )
132-
#'
133-
#' # Print the typed function
134-
#' print(multiply)
135122
print.typed_function <- function(x, ...) {
136123
cat("Typed function:\n")
137124
cat("Arguments:\n")

R/interface.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#' @return A function of class 'interface' that creates objects implementing the defined interface.
1111
#' The returned function takes named arguments corresponding to the interface properties
1212
#' and returns an object of class 'interface_object'.
13-
#' @export
14-
#'
1513
#' @examples
1614
#' # Define an interface for a person
1715
#' Person <- interface(
@@ -44,6 +42,7 @@
4442
#' )
4543
#'
4644
#' my_car <- Car(make = "Toyota", model = "Corolla", color = "red")
45+
#' @export
4746
interface <- function(..., validate_on_access = FALSE, extends = list()) {
4847
properties <- list(...)
4948

man/cash-.enum.Rd

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/cash-set-.enum.Rd

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/equals-.enum.Rd

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/print.enum.Rd

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/print.enum_generator.Rd

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/print.typed_function.Rd

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)