ODS/Storage/File/JSON.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 90.9% 20 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.0
« ODS/Table/ResultSet.pm ↑ Summary ODS/Utils.pm »
1 package ODS::Storage::File::JSON;
2  
3 1 ▶use YAOO;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 extends 'ODS::Storage::File';
7  
8 1 ▶has json => isa(object), default => sub { JSON->new->pretty(1) };
Subroutine __ANON__: called CC=1 SCAR=0.0
9  
10 1 has file_suffix => isa(string('json'));
11  
12 sub parse_data_format {
13 2 ▶ my ($self, $data) = @_;
Subroutine parse_data_format: called CC=1 SCAR=0.0
Pod undocumented
14 2 return $self->json->decode($data);
15 }
16  
17 sub stringify_data_format {
18 6 ▶ my ($self, $data) = @_;
Subroutine stringify_data_format: called CC=1 SCAR=0.0
Pod undocumented
19 6 return $self->json->encode($data);
20 }
21  
22 1 1;
« ODS/Table/ResultSet.pm ↑ Summary ODS/Utils.pm »