#' Print an aedl object
#'
#' @param x An object of class `"aedl"`.
#' @param digits Number of significant digits to print.
#' @param ... Unused.
#'
#' @return Invisibly returns `x`, the input object of class `"aedl"`.
#' @export
print.aedl <- function(x, digits = max(3, getOption("digits") - 3), ...) {
  cat("Almost-exact DerSimonian-Laird inference\n")
  cat("Method: ", x$method, "\n", sep = "")
  if (!is.null(x$conf.level)) {
    cat("Confidence level: ", x$conf.level, "\n", sep = "")
  }
  cat("\n")

  out <- c(
    estimate = x$estimate,
    se = x$se,
    ci.lb = x$ci.lb,
    ci.ub = x$ci.ub,
    pval = x$pval,
    tau2 = x$tau2,
    tau2_for_dist = x$tau2_for_dist,
    I2hat = x$I2hat,
    I2c = x$I2c,
    tau2c = x$tau2c,
    crit = x$crit
  )
  print(round(out, digits = digits), ...)
  invisible(x)
}
