NAME
Data::Object::Yaml
ABSTRACT
Data-Object Yaml Class
SYNOPSIS
use Data::Object::Yaml;
my $yaml = Data::Object::Yaml->new;
my $data = $yaml->from($arg);
DESCRIPTION
Data::Object::Yaml provides methods for reading and writing YAML data.
METHODS
This package implements the following methods.
dump
dump(HashRef $arg1) : Str
The dump method converts a data structure into a YAML string.
file
file() : Object
The file method returns a Data::Object::Path object for the given file.
from
from(Any $arg1) : Any
The from method calls dump
or load
based on the give data.
- from example
-
# given $yaml my $data = $yaml->from($string); # {,...} my $string = $yaml->from($data); # '--- {foo: ...}'
load
load(Str $arg1) : HashRef
The load method converts a string into a Perl data structure.
origin
origin() : Str
The origin method returns the package name of the underlying YAML library used.
read
read(Str $arg1) : HashRef
The read method reads YAML from the given file and returns a data structure.
space
space() : Object
The space method returns a Data::Object::Space object for the origin
.
write
writes(Str $arg1, HashRef $arg2) : Str
The write method writes the given data structure to a file as a YAML string.