Skip to contents

Keeps track of the cassette persisters in a hash-like object

Usage

persister_fetch(x = "FileSystem", file_name)

Details

There's only one option: FileSystem Private Methods

persister_get()

Gets and sets a named persister

Public fields

persisters

(list) internal use, holds persister object

name

(character)

Methods


Method new()

Create a new Persisters object

Usage

Persisters$new(persisters = list(), name = "FileSystem")

Arguments

persisters

(list) a list

name

(character) Persister name, only option right now is "FileSystem"

Returns

A new Persisters object


Method clone()

The objects of this class are cloneable with this method.

Usage

Persisters$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

(aa <- Persisters$new())
#> <Persisters>
#>   Public:
#>     clone: function (deep = FALSE) 
#>     initialize: function (persisters = list(), name = "FileSystem") 
#>     name: FileSystem
#>     persisters: R6ClassGenerator
#>   Private:
#>     persister_get: function () 
aa$name
#> [1] "FileSystem"
aa$persisters
#> <FileSystem> object generator
#>   Public:
#>     file_name: NULL
#>     write_fxn: NULL
#>     content: NULL
#>     path: NULL
#>     write2disk: FALSE
#>     initialize: function (file_name = NULL, write_fxn = NULL, content = NULL, 
#>     get_cassette: function (file_name = NULL) 
#>     is_empty: function () 
#>     set_cassette: function (file_name = NULL, content) 
#>     clone: function (deep = FALSE) 
#>   Private:
#>     storage_location: function () 
#>     absolute_path_to_file: function (x, y) 
#>   Parent env: <environment: namespace:vcr>
#>   Locked objects: TRUE
#>   Locked class: FALSE
#>   Portable: TRUE
yaml_serializer <- aa$persisters$new()
yaml_serializer
#> <FileSystem>
#>   Public:
#>     clone: function (deep = FALSE) 
#>     content: NULL
#>     file_name: NULL
#>     get_cassette: function (file_name = NULL) 
#>     initialize: function (file_name = NULL, write_fxn = NULL, content = NULL, 
#>     is_empty: function () 
#>     path: .
#>     set_cassette: function (file_name = NULL, content) 
#>     write2disk: FALSE
#>     write_fxn: NULL
#>   Private:
#>     absolute_path_to_file: function (x, y) 
#>     storage_location: function ()