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
|
|
53590
|
use strict; |
|
109
|
|
|
|
|
299
|
|
|
109
|
|
|
|
|
3259
|
|
6
|
109
|
|
|
109
|
|
638
|
use warnings; |
|
109
|
|
|
|
|
292
|
|
|
109
|
|
|
|
|
2932
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
646
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
264
|
|
|
109
|
|
|
|
|
10408
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
806
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
273
|
|
|
109
|
|
|
|
|
686
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900059'; # 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
|
2591
|
my ($self, $proto, $field, $param) = @_; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# by default fields should have a filtering directive |
28
|
|
|
|
|
|
|
# unless already specified |
29
|
|
|
|
|
|
|
|
30
|
1009
|
100
|
|
|
|
3327
|
$field->{filtering} = $proto->filtering unless defined $field->{filtering}; |
31
|
|
|
|
|
|
|
|
32
|
1009
|
|
|
|
|
2517
|
return $self; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |