| 1 | package HTML::Shakan::Filters; | ||||||||||||||||||||
| 2 | 23 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 23 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 23 | ▶ | use Scalar::Util 'blessed'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | sub _get_filter { | ||||||||||||||||||||
| 7 | 7 | ▶ | my $pkg = shift; | ||||||||||||||||||
|
Subroutine
_get_filter: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 8 | 7 | ▶ | $pkg = $pkg =~ s/^\+// ? $pkg : "HTML::Shakan::Filter::$pkg"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 9 | 7 | Mouse::load_class($pkg); | |||||||||||||||||||
| 10 | 7 | return $pkg->new(); | |||||||||||||||||||
| 11 | } | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | sub filter { | ||||||||||||||||||||
| 14 | 49 | ▶ | my ($class, $filter_ary, $val) = @_; | ||||||||||||||||||
|
Subroutine
filter: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||
| 15 | 49 | ▶ | $filter_ary = [$filter_ary] unless (ref $filter_ary||'') eq 'ARRAY'; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
ref $filter_ary || ''
MC/DC100%1/1
ref $filter_ary || ''
ref $filter_ary
Truth table100%2/2
A
A= ref $filter_ary
| |||||||||||||||||||||
| 16 | 49 | for my $filter (@$filter_ary) { | |||||||||||||||||||
| 17 | 8 | ▶ | unless (blessed $filter) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 18 | 7 | $filter = _get_filter($filter); | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | 8 | $val = $filter->filter($val); | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | 49 | $val; | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 23 | 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 | |||||||||||||||||||||