The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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

  # given $yaml

  my $string = $yaml->dump($data);

  # '--- {name: ...}'

The dump method converts a data structure into a YAML string.

from

  # given $yaml

  my $data = $yaml->from($string);

  # {,...}

  my $string = $yaml->from($data);

  # '--- {foo: ...}'

The from method calls dump or load based on the give data.

load

  # given $yaml

  my $data = $yaml->load($string);

  # {,...}

The load method converts a string into a Perl data structure.

read

  # given $yaml

  my $data = $yaml->read($file);

  # {,...}

The read method reads YAML from the given file and returns a data structure.

write

  # given $yaml

  my $string = $yaml->write($file, $data);

  # ...

The write method writes the given data structure to a file as a YAML string.

space

  # given $yaml

  my $space = $yaml->space();

  # YAML::Tiny

The space method returns a Data::Object::Space object for the origin.

file

  # given $yaml

  my $path = $yaml->file($file);

  # ...

The file method returns a Data::Object::Path object for the given file.

origin

  # given $yaml

  my $origin = $yaml->origin();

  # YAML::Tiny

The origin method returns the package name of the underlying YAML library used.