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.5.0'; |
5
|
6
|
|
|
6
|
|
4675
|
use strict; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
198
|
|
6
|
6
|
|
|
6
|
|
33
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
147
|
|
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
38
|
use File::Serialize; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
46
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
394
|
use Moo; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
34
|
|
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__ |