NAME
Data::Object::Json
ABSTRACT
Data-Object Json Class
SYNOPSIS
use Data::Object::Json;
my $json = Data::Object::Json->new;
my $data = $json->from($arg);
DESCRIPTION
Data::Object::Json provides methods for reading and writing JSON data.
METHODS
This package implements the following methods.
dump
dump(HashRef $arg1) : Str
The dump method converts a data structure into a JSON 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 $json my $data = $json->from($string); # {,...} my $string = $json->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 JSON library used.
read
read(Str $arg1) : HashRef
The read method reads JSON 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 JSON string.