File Coverage

blib/lib/Path/Dispatcher/Rule/Intersection.pm
Criterion Covered Total %
statement 13 13 100.0
branch 4 4 100.0
condition n/a
subroutine 3 3 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package Path::Dispatcher::Rule::Intersection;
2             # ABSTRACT: all rules must match
3              
4             our $VERSION = '1.07';
5              
6 31     31   248 use Moo;
  31         75  
  31         178  
7             extends 'Path::Dispatcher::Rule';
8              
9             with 'Path::Dispatcher::Role::Rules';
10              
11             sub _match {
12 6     6   14 my $self = shift;
13 6         11 my $path = shift;
14              
15 6         17 my @rules = $self->rules;
16 6 100       25 return if @rules == 0;
17              
18 5         13 for my $rule (@rules) {
19 8 100       39 return unless $rule->match($path);
20             }
21              
22 2         8 return {};
23             }
24              
25             __PACKAGE__->meta->make_immutable;
26 31     31   13309 no Moo;
  31         90  
  31         138  
27              
28             1;
29              
30             __END__