line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
5
|
|
|
5
|
|
1466
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
145
|
|
3
|
5
|
|
|
5
|
|
22
|
use warnings; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
217
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package MetaPOD::Format::JSON::v1; |
6
|
|
|
|
|
|
|
BEGIN { |
7
|
5
|
|
|
5
|
|
128
|
$MetaPOD::Format::JSON::v1::AUTHORITY = 'cpan:KENTNL'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
{ |
10
|
|
|
|
|
|
|
$MetaPOD::Format::JSON::v1::VERSION = '0.3.0'; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ABSTRACT: MetaPOD::JSON v1 SPEC Implementation |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
905
|
use Moo; |
|
5
|
|
|
|
|
22247
|
|
|
5
|
|
|
|
|
39
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
with 'MetaPOD::Format::JSON::Decoder::v1', |
19
|
|
|
|
|
|
|
'MetaPOD::Format::JSON::PostCheck::v1', |
20
|
|
|
|
|
|
|
'MetaPOD::Format::JSON::does::v1', |
21
|
|
|
|
|
|
|
'MetaPOD::Format::JSON::inherits::v1', |
22
|
|
|
|
|
|
|
'MetaPOD::Format::JSON::namespace::v1'; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub features { |
26
|
4
|
|
|
4
|
1
|
13
|
return qw( does inherits namespace ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub dispatch_keys { |
31
|
13
|
|
|
13
|
1
|
27
|
my ( $self, $data_decoded, $result ) = @_; |
32
|
13
|
|
|
|
|
63
|
for my $feature ( $self->features ) { |
33
|
48
|
|
|
|
|
2182
|
my $method = 'add_' . $feature; |
34
|
48
|
100
|
|
|
|
233
|
next unless exists $data_decoded->{$feature}; |
35
|
31
|
|
|
|
|
123
|
my $copy = delete $data_decoded->{$feature}; |
36
|
31
|
|
|
|
|
206
|
$self->$method( $copy, $result ); |
37
|
|
|
|
|
|
|
} |
38
|
13
|
|
|
|
|
1058
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub add_segment { |
43
|
13
|
|
|
13
|
1
|
39
|
my ( $self, $segment, $result ) = @_; |
44
|
13
|
|
|
|
|
98
|
my $data = $self->decode( $segment->{data} ); |
45
|
13
|
|
|
|
|
57
|
$self->dispatch_keys( $data, $result ); |
46
|
13
|
|
|
|
|
78
|
$self->postcheck($data); |
47
|
13
|
|
|
|
|
41
|
return $self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |