blib/lib/Catmandu/Store/Multi.pm

filter: Statementstmt 79.3% 23 / 29 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 1 totaltotal 75.0% 30 / 40 CC 3 SCAR 8.4
CC
3
Cov
77%
drop
6.0
__ANON__
2.1
__ANON__
2.0
CRAP 2.3
« blib/lib/Catmandu/Store.pm ↑ Summary blib/lib/Catmandu/Fix/Bind/importer.pm »
1 package Catmandu::Store::Multi;
2  
3 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '1.0201_02';
6  
7 1 ▶use Catmandu::Util qw(:is);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Catmandu::Store::Multi::Bag;
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::Store';
13  
14 has stores => (
15 is => 'ro',
16 0 ▶ default => sub {[]},
Subroutine __ANON__: not called CC=1 SCAR=6.9
17 coerce => sub {
18 1 ▶ my $stores = $_[0];
Subroutine __ANON__: called CC=2 SCAR=7.4
19 return [
20 map {
21 1 ▶ if (is_string($_)) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_string($_)) { } 0 2 2
22 0 Catmandu->store($_);
23 }
24 else {
25 2 $_;
26 }
27 } @$stores
28 ];
29 },
30 1 );
31  
32 sub drop {
33 0 ▶ my ($self) = @_;
Subroutine drop: not called CC=2 SCAR=17.9
Pod undocumented
34 0 for my $store (@{$self->store->stores}) {
35 0 $store->drop;
36 }
37 }
38  
39 1 1;
40  
41 __END__
42  
43 =pod
44  
45 =head1 NAME
46  
47 Catmandu::Store::Multi - A store that adds your data to multiple stores
48  
49 =cut
« blib/lib/Catmandu/Store.pm ↑ Summary blib/lib/Catmandu/Fix/Bind/importer.pm »