Skip to content

Commit

Permalink
Update to proper S7::method methods. (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonthegeek authored Sep 11, 2023
1 parent d085d0c commit 5283018
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Suggests:
testthat (>= 3.0.0)
Remotes:
jonthegeek/stbl,
rconsortium/S7
rconsortium/S7#343
Config/testthat/edition: 3
Config/testthat/parallel: true
Encoding: UTF-8
Expand Down
6 changes: 0 additions & 6 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Generated by roxygen2: do not edit by hand

S3method(length,"rapid::contact")
S3method(length,"rapid::info")
S3method(length,"rapid::license")
S3method(length,"rapid::rapid")
S3method(length,"rapid::servers")
S3method(length,"rapid::string_replacements")
export(as_contact)
export(as_info)
export(as_license)
Expand Down
3 changes: 1 addition & 2 deletions R/info-01-contact.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ contact <- S7::new_class(
)
)

#' @export
`length.rapid::contact` <- function(x) {
S7::method(length, contact) <- function(x) {
max(lengths(S7::props(x)))
}

Expand Down
3 changes: 1 addition & 2 deletions R/info-01-license.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ license <- S7::new_class(
}
)

#' @export
`length.rapid::license` <- function(x) {
S7::method(length, license) <- function(x) {
max(lengths(S7::props(x)))
}

Expand Down
3 changes: 1 addition & 2 deletions R/info-zz-info.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ info <- S7::new_class(
}
)

#' @export
`length.rapid::info` <- function(x) {
S7::method(length, info) <- function(x) {
max(lengths(S7::props(x)))
}

Expand Down
3 changes: 1 addition & 2 deletions R/servers-01-string_replacements.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ string_replacements <- S7::new_class(
}
)

#' @export
`length.rapid::string_replacements` <- function(x) {
S7::method(length, string_replacements) <- function(x) {
length(x@name)
}

Expand Down
3 changes: 1 addition & 2 deletions R/servers-zz-servers.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ servers <- S7::new_class(
}
)

#' @export
`length.rapid::servers` <- function(x) {
S7::method(length, servers) <- function(x) {
length(x@url)
}

Expand Down
3 changes: 1 addition & 2 deletions R/zz-rapid.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ rapid <- S7::new_class(
}
)

#' @export
`length.rapid::rapid` <- function(x) {
S7::method(length, rapid) <- function(x) {
length(x@info)
}

Expand Down

0 comments on commit 5283018

Please sign in to comment.