line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Cpanel::JSON::XS (); |
7
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
8
|
1
|
|
|
1
|
|
6
|
use namespace::clean; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
9
|
1
|
|
|
1
|
|
419
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
10
|
|
|
|
|
|
|
Cpanel::JSON::XS::encode_json($_[1]); |
11
|
|
|
|
|
|
|
} |
12
|
1
|
|
|
1
|
0
|
514
|
|
13
|
|
|
|
|
|
|
Cpanel::JSON::XS::decode_json($_[1]); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
0
|
30
|
1; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=pod |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Catmandu::Serializer - A (de)serializer from and to json |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
package MyPackage; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
use Moo; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
with 'Catmandu::Serializer'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# You have now serialize and deserialize methods available |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
package main; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $obj = MyPackage->new; |
38
|
|
|
|
|
|
|
my $obj = MyPackage->new(serializer => 'json'); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
$obj->serialize( { foo => 'bar' } ); # JSON |
41
|
|
|
|
|
|
|
$obj->deserialize( "{'foo':'bar'}" ); # Perl |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SEE ALSO |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L<Catmandu::Serializer> |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |