Learn R Programming

vcr (version 0.2.6)

YAML: The YAML serializer

Description

The YAML serializer

Arguments

file_extension

(character) A file extension

path

(character) full path to the yaml file

string

(character) path string

Details

Methods

serialize(x)

Serializes the given hash using internal fxn write_yaml

deserialize_string(string = NULL)

Deserializes the given string using yaml::yaml.load

deserialize_path()

Deserializes the given string using yaml::yaml.load_file

Examples

Run this code
# NOT RUN {
(yy <- YAML$new(path = "stuff2"))
fun <- yy$serialize()
fun(list(http_interactions = list(response = list(body = "bar"))),
  path = yy$path, bytes = FALSE)
yy$deserialize_path()
yy$deserialize_string(string = "- hey\n- hi\n- hello")
yy$deserialize_string(string = "- foo\n- bar\n- 3.14")
# }

Run the code above in your browser using DataLab