line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Serialize::Serializer::JSONY; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
3
|
|
|
|
|
|
|
#ABSTRACT: JSONY serializer for File::Serialize |
4
|
|
|
|
|
|
|
$File::Serialize::Serializer::JSONY::VERSION = '1.4.0'; |
5
|
6
|
|
|
6
|
|
4787
|
use strict; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
185
|
|
6
|
6
|
|
|
6
|
|
30
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
151
|
|
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
30
|
use File::Serialize; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
48
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
393
|
use Moo; |
|
6
|
|
|
|
|
39
|
|
|
6
|
|
|
|
|
32
|
|
11
|
|
|
|
|
|
|
with 'File::Serialize::Serializer'; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
1
|
|
sub extensions { qw/ jsony / }; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub serialize { |
16
|
|
|
|
|
|
|
my( $self, $data, $options ) = @_; |
17
|
|
|
|
|
|
|
serialize_file \my $output, $data, { format => 'json' }; |
18
|
|
|
|
|
|
|
return $output; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub deserialize { |
23
|
|
|
|
|
|
|
my( $self, $data, $options ) = @_; |
24
|
|
|
|
|
|
|
JSONY->new->load($data); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |