line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ODS::Storage::File::JSON; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use YAOO; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
1202
|
use JSON; |
|
1
|
|
|
|
|
9997
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'ODS::Storage::File'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has json => isa(object), default => sub { JSON->new->pretty(1) }; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has file_suffix => isa(string('json')); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub parse_data_format { |
13
|
2
|
|
|
2
|
0
|
16
|
my ($self, $data) = @_; |
14
|
2
|
|
|
|
|
6
|
return $self->json->decode($data); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub stringify_data_format { |
18
|
6
|
|
|
6
|
0
|
12
|
my ($self, $data) = @_; |
19
|
6
|
|
|
|
|
9
|
return $self->json->encode($data); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |