File Coverage

blib/lib/Path/Dispatcher/Rule/Chain.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Path::Dispatcher::Rule::Chain;
2             # ABSTRACT: Chain rules for Path::Dispatcher
3              
4             our $VERSION = '1.08';
5              
6 31     31   229 use Moo;
  31         64  
  31         198  
7             extends 'Path::Dispatcher::Rule::Always';
8              
9             around payload => sub {
10             my $orig = shift;
11             my $self = shift;
12             my $payload = $self->$orig(@_);
13              
14             if (!@_) {
15             return sub {
16             $payload->(@_);
17             die "Path::Dispatcher next rule\n"; # FIXME From Path::Dispatcher::Declarative... maybe this should go in a common place?
18             };
19             }
20              
21             return $payload;
22             };
23              
24             __PACKAGE__->meta->make_immutable;
25 31     31   14262 no Moo;
  31         132  
  31         172  
26              
27             1;
28              
29             __END__
30              
31             =pod
32              
33             =encoding UTF-8
34              
35             =head1 NAME
36              
37             Path::Dispatcher::Rule::Chain - Chain rules for Path::Dispatcher
38              
39             =head1 VERSION
40              
41             version 1.08
42              
43             =head1 SUPPORT
44              
45             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Path-Dispatcher>
46             (or L<bug-Path-Dispatcher@rt.cpan.org|mailto:bug-Path-Dispatcher@rt.cpan.org>).
47              
48             =head1 AUTHOR
49              
50             Shawn M Moore, C<< <sartak at bestpractical.com> >>
51              
52             =head1 COPYRIGHT AND LICENSE
53              
54             This software is copyright (c) 2020 by Shawn M Moore.
55              
56             This is free software; you can redistribute it and/or modify it under
57             the same terms as the Perl 5 programming language system itself.
58              
59             =cut