File Coverage

blib/lib/Data/Validator/Role/Sequenced.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Data::Validator::Role::Sequenced;
2 5     5   5308 use Mouse::Role;
  5         1392  
  5         44  
3 5     5   1730 use Mouse::Util::TypeConstraints ();
  5         11  
  5         1274  
4              
5             around initialize => sub {
6             shift; # original method; not used
7             my $self = shift;
8             my %args;
9             if( @_ and Mouse::Util::TypeConstraints::HashRef($_[-1]) ) {
10             %args = %{ pop @_ };
11             }
12              
13             my $rules = $self->rules;
14             foreach my $i( 0 .. (@_ - 1) ) {
15             my $rule = $rules->[$i] || +{ name => "[$i]" };
16             $args{ $rule->{name} } = $_[$i];
17             }
18             return \%args;
19             };
20              
21 5     5   395 no Mouse::Role;
  5         12  
  5         56  
22             1;
23             __END__