Catmandu/Exporter/Multi.pm

filter: Statementstmt 93.5% 29 / 31 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 2 totaltotal 86.3% 38 / 44 CC 4 SCAR 4.7
CC
4
Cov
91%
__ANON__
2.1
__ANON__
2.0
add
2.0
CRAP 1.6
« Catmandu/Error.pm ↑ Summary Catmandu/Fix/flatten.pm »
1 package Catmandu::Exporter::Multi;
2  
3 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '1.2025';
6  
7 1 ▶use Catmandu::Util qw(is_string);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Catmandu;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 with 'Catmandu::Exporter';
13  
14 has exporters => (
15 is => 'ro',
16 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
17 1 ▶ coerce => sub {
Subroutine __ANON__: called CC=2 SCAR=7.4
18 1 my $exporters = $_[0];
19 return [
20 map {
21 1 ▶ if (is_string($_)) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_string($_)) { } 0 2 2
22 0 Catmandu->exporter($_);
23 }
24 else {
25 2 $_;
26 }
27 } @$exporters
28 ];
29 },
30 1 );
31  
32 3 ▶sub add {
Subroutine add: called CC=2 SCAR=6.9
Pod undocumented
33 3 my ($self, $data) = @_;
34 3 $_->add($data) for @{$self->exporters};
35 }
36  
37 1 ▶sub commit {
Subroutine commit: called CC=2 SCAR=6.9
Pod undocumented
38 1 my ($self) = @_;
39 1 $_->commit for @{$self->exporters};
40 }
41  
42 1 1;
43  
44 __END__
« Catmandu/Error.pm ↑ Summary Catmandu/Fix/flatten.pm »