TreeValidator/Result/Repeating.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 32 / 32 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« TreeValidator/Result/Leaf.pm ↑ Summary
1 package Data::TreeValidator::Result::Repeating;
2 {
3 4 $Data::TreeValidator::Result::Repeating::VERSION = '0.04';
4 }
5 # ABSTRACT: Returns the result of processing a repeating branch
6 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶use Data::TreeValidator::Types qw( Result );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use MooseX::Types::Moose qw( ArrayRef );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 4 with 'Data::TreeValidator::Result';
13  
14 4 has 'results' => (
15 isa => ArrayRef[Result],
16 traits => [ 'Array' ],
17 handles => {
18 results => 'elements',
19 result_count => 'count',
20 }
21 );
22  
23 3 ▶sub valid {
Subroutine valid: called CC=1 SCAR=0.0
Pod documented
24 3 my $self = shift;
25 3 (grep { $_->valid } $self->results) == $self->result_count;
26 }
27  
28 3 ▶sub clean {
Subroutine clean: called CC=1 SCAR=0.0
Pod documented
29 3 my $self = shift;
30 return [
31 5 map { $_->clean }
32 3 grep { $_->valid }
33 $self->results
34 ];
35 }
36  
37 4 1;
38  
39  
40  
41 __END__
« TreeValidator/Result/Leaf.pm ↑ Summary