A custom print method for objects of class explorecourses_cache_list
. Displays
the cache contents in a formatted, color-coded layout with summary information
and files arranged in columns.
Usage
# S3 method for class 'explorecourses_cache_list'
print(x, ...)
Arguments
- x
An object of class
explorecourses_cache_list
, typically returned bylist_cache()
.- ...
Additional arguments passed to print (currently unused).
Details
The print method provides a formatted display including:
Header with "Cache contents:" in cyan
Summary information in blue:
Total number of cached files
Academic year (if filtered)
Cache directory path
Files listed in columns (5 files per row)
Special handling for empty cache (warning message)
Output formatting:
Uses color for emphasis (cyan and blue)
Properly pluralizes file counts
Aligns files in 25-character width columns
Uses filesystem path formatting for directory paths
Note
This is a method for the generic print()
function and is automatically called
when printing objects of class explorecourses_cache_list
. It should not typically
be called directly.
See also
list_cache()
which returns objects of classexplorecourses_cache_list
Examples
if (FALSE) { # \dontrun{
# Normal usage through print generic
cache_files <- list_cache()
print(cache_files) # Automatically calls this method
# Or simply
cache_files # Auto-printing also uses this method
# Example with year filter
year_files <- list_cache(year = "20232024")
print(year_files)
} # }