Learn R Programming

vcr (version 1.6.0)

JSON: The JSON serializer

Description

class with methods for serializing via jsonlite

Arguments

Super class

vcr::Serializer -> JSON

Methods


Method new()

Create a new JSON object

Usage

JSON$new(path = NULL)

Arguments

path

(character) full path to the yaml file

Returns

A new JSON object


Method serialize()

Serializes the given hash using internal fxn write_json

Usage

JSON$serialize(x, path, bytes)

Arguments

x

(list) the object to serialize

path

(character) the file path

bytes

(logical) whether to preserve exact body bytes or not

Returns

(character) the json string to write to disk


Method deserialize()

Deserializes the content at the file path using jsonlite::fromJSON

Usage

JSON$deserialize(cassette)

Arguments

cassette

the current cassette object so it's properties can be retrieved

Returns

(list) the deserialized object, an R list


Method clone()

The objects of this class are cloneable with this method.

Usage

JSON$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.