1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/persisters-file.R
\name{FileSystem}
\alias{FileSystem}
\title{File system persister}
\description{
The only built-in cassette persister. Persists cassettes
to the file system.
}
\details{
\strong{Private Methods}
\describe{
\item{\code{storage_location()}}{
Get storage location
}
\item{\code{absolute_path_to_file()}}{
Get absolute path to the \code{storage_location}
}
}
}
\keyword{internal}
\section{Public fields}{
\if{html}{\out{<div class="r6-fields">}}
\describe{
\item{\code{file_name}}{(character) the file name, not whole path}
\item{\code{write_fxn}}{(character) fxn to use for writing to disk}
\item{\code{content}}{(character) content to record to a cassette}
\item{\code{path}}{(character) storage directory for cassettes}
\item{\code{write2disk}}{(character) write to disk or make a new FileSystem}
}
\if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-new}{\code{FileSystem$new()}}
\item \href{#method-get_cassette}{\code{FileSystem$get_cassette()}}
\item \href{#method-is_empty}{\code{FileSystem$is_empty()}}
\item \href{#method-set_cassette}{\code{FileSystem$set_cassette()}}
\item \href{#method-clone}{\code{FileSystem$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
Create a new \code{FileSystem} object
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{FileSystem$new(
file_name = NULL,
write_fxn = NULL,
content = NULL,
path = NULL,
write2disk = FALSE
)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{file_name}}{(character) the file name, not whole path}
\item{\code{write_fxn}}{(character) fxn to use for writing to disk}
\item{\code{content}}{(character) content to record to a cassette}
\item{\code{path}}{(character) storage directory for cassettes}
\item{\code{write2disk}}{(logical) write to disk or just make a new FileSystem
object. Default: \code{FALSE}}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A new \code{FileSystem} object
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-get_cassette"></a>}}
\if{latex}{\out{\hypertarget{method-get_cassette}{}}}
\subsection{Method \code{get_cassette()}}{
Gets the cassette for the given storage key (file name)
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{FileSystem$get_cassette(file_name = NULL)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{file_name}}{(character) the file name, not whole path}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
named list, from \code{yaml::yaml.load_file}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-is_empty"></a>}}
\if{latex}{\out{\hypertarget{method-is_empty}{}}}
\subsection{Method \code{is_empty()}}{
Checks if a cassette is empty or not
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{FileSystem$is_empty()}\if{html}{\out{</div>}}
}
\subsection{Returns}{
logical
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-set_cassette"></a>}}
\if{latex}{\out{\hypertarget{method-set_cassette}{}}}
\subsection{Method \code{set_cassette()}}{
Sets the cassette for the given storage key (file name)
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{FileSystem$set_cassette(file_name = NULL, content)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{file_name}}{(character) the file name, not whole path}
\item{\code{content}}{(character) content to record to a cassette}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
no return; writes to disk
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-clone"></a>}}
\if{latex}{\out{\hypertarget{method-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{FileSystem$clone(deep = FALSE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}
|