R/ping.r

Defines functions ping

Documented in ping

#' Ping a CouchDB server
#'
#' @export
#' @template all
#' @template return
#' @examples \dontrun{
#' # initialize a CouchDB connection
#' user <- Sys.getenv("COUCHDB_TEST_USER")
#' pwd <- Sys.getenv("COUCHDB_TEST_PWD")
#' (x <- Cushion$new(user=user, pwd=pwd))
#'
#' # call ping on the cushion object, or pass the cushion to ping()
#' x$ping()
#' ping(x)
#' ping(x, as = "json")
#' }
ping <- function(cushion, as = 'list', ...) {
  check_cushion(cushion)
  cushion$ping(as, ...)
}
ropensci/sofa documentation built on March 10, 2024, 4:26 a.m.