File Coverage

blib/lib/Validation/Class/Directive/Filtering.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             # ABSTRACT: Filtering Directive for Validation Class Field Definitions
2              
3             package Validation::Class::Directive::Filtering;
4              
5 109     109   42853 use strict;
  109         239  
  109         2679  
6 109     109   491 use warnings;
  109         214  
  109         2382  
7              
8 109     109   481 use base 'Validation::Class::Directive';
  109         198  
  109         8603  
9              
10 109     109   645 use Validation::Class::Util;
  109         211  
  109         564  
11              
12             our $VERSION = '7.900058'; # VERSION
13              
14              
15             has 'mixin' => 1;
16             has 'field' => 1;
17             has 'multi' => 0;
18             has 'dependencies' => sub {{
19             normalization => ['alias'],
20             validation => []
21             }};
22              
23             sub normalize {
24              
25 1009     1009 0 2225 my ($self, $proto, $field, $param) = @_;
26              
27             # by default fields should have a filtering directive
28             # unless already specified
29              
30 1009 100       2854 $field->{filtering} = $proto->filtering unless defined $field->{filtering};
31              
32 1009         2213 return $self;
33              
34             }
35              
36             1;
37              
38             __END__