The only built-in cassette persister. Persists cassettes to the file system.
file_name
(character) the file name, not whole path
write_fxn
(character) fxn to use for writing to disk
content
(character) content to record to a cassette
path
(character) storage directory for cassettes
write2disk
(character) write to disk or make a new FileSystem
new()
Create a new FileSystem
object
FileSystem$new(
file_name = NULL,
write_fxn = NULL,
content = NULL,
path = NULL,
write2disk = FALSE
)
file_name
(character) the file name, not whole path
write_fxn
(character) fxn to use for writing to disk
content
(character) content to record to a cassette
path
(character) storage directory for cassettes
write2disk
(logical) write to disk or just make a new FileSystem
object. Default: FALSE
A new FileSystem
object
get_cassette()
Gets the cassette for the given storage key (file name)
FileSystem$get_cassette(file_name = NULL)
file_name
(character) the file name, not whole path
named list, from yaml::yaml.load_file
is_empty()
Checks if a cassette is empty or not
FileSystem$is_empty()
logical
set_cassette()
Sets the cassette for the given storage key (file name)
FileSystem$set_cassette(file_name = NULL, content)
file_name
(character) the file name, not whole path
content
(character) content to record to a cassette
no return; writes to disk
clone()
The objects of this class are cloneable with this method.
FileSystem$clone(deep = FALSE)
deep
Whether to make a deep clone.
Private Methods
storage_location()
Get storage location
absolute_path_to_file()
Get absolute path to the storage_location