line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Shakan::Filters; |
2
|
24
|
|
|
24
|
|
67522
|
use strict; |
|
24
|
|
|
|
|
48
|
|
|
24
|
|
|
|
|
595
|
|
3
|
24
|
|
|
24
|
|
118
|
use warnings; |
|
24
|
|
|
|
|
50
|
|
|
24
|
|
|
|
|
563
|
|
4
|
24
|
|
|
24
|
|
112
|
use Scalar::Util 'blessed'; |
|
24
|
|
|
|
|
48
|
|
|
24
|
|
|
|
|
4162
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub _get_filter { |
7
|
7
|
|
|
7
|
|
13
|
my $pkg = shift; |
8
|
7
|
50
|
|
|
|
35
|
$pkg = $pkg =~ s/^\+// ? $pkg : "HTML::Shakan::Filter::$pkg"; |
9
|
7
|
|
|
|
|
31
|
Mouse::load_class($pkg); |
10
|
7
|
|
|
|
|
569
|
return $pkg->new(); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub filter { |
14
|
53
|
|
|
53
|
0
|
24206
|
my ($class, $filter_ary, $val) = @_; |
15
|
53
|
100
|
100
|
|
|
228
|
$filter_ary = [$filter_ary] unless (ref $filter_ary||'') eq 'ARRAY'; |
16
|
53
|
|
|
|
|
122
|
for my $filter (@$filter_ary) { |
17
|
8
|
100
|
|
|
|
39
|
unless (blessed $filter) { |
18
|
7
|
|
|
|
|
21
|
$filter = _get_filter($filter); |
19
|
|
|
|
|
|
|
} |
20
|
8
|
|
|
|
|
328
|
$val = $filter->filter($val); |
21
|
|
|
|
|
|
|
} |
22
|
53
|
|
|
|
|
652
|
$val; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
HTML::Shakan::Filters - filter class manager |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 DESCRIPTION |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
INTERNAL USE ONLY |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SEE ALSO |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
L<HTML::Shakan> |
39
|
|
|
|
|
|
|
|