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.08';
5              
6 31     31   225 use Moo;
  31         81  
  31         193  
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         10 my $path = shift;
14              
15 6         135 my @rules = $self->rules;
16 6 100       130 return if @rules == 0;
17              
18 5         20 for my $rule (@rules) {
19 8 100       43 return unless $rule->match($path);
20             }
21              
22 2         7 return {};
23             }
24              
25             __PACKAGE__->meta->make_immutable;
26 31     31   13855 no Moo;
  31         81  
  31         174  
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Path::Dispatcher::Rule::Intersection - all rules must match
39              
40             =head1 VERSION
41              
42             version 1.08
43              
44             =head1 SYNOPSIS
45              
46             =head1 DESCRIPTION
47              
48             =head1 ATTRIBUTES
49              
50             =head2 rules
51              
52             =head1 SUPPORT
53              
54             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Path-Dispatcher>
55             (or L<bug-Path-Dispatcher@rt.cpan.org|mailto:bug-Path-Dispatcher@rt.cpan.org>).
56              
57             =head1 AUTHOR
58              
59             Shawn M Moore, C<< <sartak at bestpractical.com> >>
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2020 by Shawn M Moore.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut