line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
3854
|
use strict; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
219
|
|
2
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
289
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MetaPOD::Format::JSON::interface::v1_1; |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
5
|
|
|
5
|
|
160
|
$MetaPOD::Format::JSON::interface::v1_1::AUTHORITY = 'cpan:KENTNL'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
{ |
9
|
|
|
|
|
|
|
$MetaPOD::Format::JSON::interface::v1_1::VERSION = '0.3.0'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: Implementation of JSON/interface format component |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
937
|
use Moo::Role; |
|
5
|
|
|
|
|
53093
|
|
|
5
|
|
|
|
|
35
|
|
16
|
5
|
|
|
5
|
|
1625
|
use Carp qw(croak); |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
1724
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub supported_interfaces { |
20
|
0
|
|
|
0
|
1
|
0
|
return qw( class role type_library exporter single_class function ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub check_interface { |
25
|
0
|
|
|
0
|
1
|
0
|
my ( $self, @ifs ) = @_; |
26
|
0
|
|
|
|
|
0
|
my $supported = { map { ( $_, 1 ) } $self->supported_interfaces_v1_1 }; |
|
0
|
|
|
|
|
0
|
|
27
|
0
|
|
|
|
|
0
|
for my $if (@ifs) { |
28
|
0
|
0
|
|
|
|
0
|
if ( not exists $supported->{$if} ) { |
29
|
0
|
|
|
|
|
0
|
croak("interface type $if unsupported in v1.1.0"); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
0
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub add_interface { |
37
|
9
|
|
|
9
|
1
|
17
|
my ( $self, $interface, $result ) = @_; |
38
|
9
|
50
|
33
|
|
|
61
|
if ( defined $interface and not ref $interface ) { |
39
|
9
|
|
|
|
|
44
|
return $result->add_interface($interface); |
40
|
|
|
|
|
|
|
} |
41
|
0
|
0
|
0
|
|
|
|
if ( defined $interface and ref $interface eq 'ARRAY' ) { |
42
|
0
|
|
|
|
|
|
return $result->add_interface( @{$interface} ); |
|
0
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
0
|
|
|
|
|
|
croak 'Unsupported reftype ' . ref $interface; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |