File Coverage

blib/lib/Data/Validator/Role/AllowExtra.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Data::Validator::Role::AllowExtra;
2 2     2   2243 use Mouse::Role;
  2         972  
  2         14  
3              
4             has extra_args => (
5             is => 'rw',
6             isa => 'ArrayRef',
7             auto_deref => 1,
8             lazy => 1,
9             default => sub { [] },
10             required => 0,
11             );
12              
13             around unknown_parameters => sub {
14             my($next, $self, $rules, $args) = @_;
15             @{ $self->extra_args } = $self->$next($rules, $args);
16             return;
17             };
18              
19             around validate => sub {
20             my($next, $self, @args) = @_;
21             my @retvals = $self->$next(@args);
22             push @retvals, $self->extra_args;
23             @{$self->extra_args} = ();
24             return @retvals;
25             };
26              
27 2     2   902 no Mouse::Role;
  2         5  
  2         8  
28             1;
29             __END__