R/zzz.R

Defines functions register_s3_method .onLoad

.import.rio_beancount <- register # nolint
.import.rio_bean <- register # nolint
.import.rio_ledger <- register # nolint
.import.rio_hledger <- register # nolint

.onLoad <- function(...) {
    register_s3_method("rio", ".import", "rio_beancount")
    register_s3_method("rio", ".import", "rio_bean")
    register_s3_method("rio", ".import", "rio_hledger")
    register_s3_method("rio", ".import", "rio_ledger")

    invisible(NULL)
}

register_s3_method <- function(pkg, generic, class) {
    fun <- get(paste0(generic, ".", class), envir = parent.frame())
    if (requireNamespace(pkg, quietly = TRUE))
        registerS3method(generic, class, fun, envir = asNamespace(pkg))
    invisible(NULL)
}

Try the ledger package in your browser

Any scripts or data that you put into this service are public.

ledger documentation built on May 29, 2024, 1:21 a.m.