File Coverage

blib/lib/Plack/Middleware.pm
Criterion Covered Total %
statement 23 23 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 0 1 0.0
total 32 33 96.9


line stmt bran cond sub pod time code
1             package Plack::Middleware;
2 94     94   44531 use strict;
  94         188  
  94         3231  
3 94     94   1060 use warnings;
  94         224  
  94         4522  
4 94     94   456 use Carp ();
  94         2271  
  94         2493  
5 94     94   361 use parent qw(Plack::Component);
  94         262  
  94         914  
6 94     94   6017 use Plack::Util;
  94         162  
  94         2483  
7 94     94   40571 use Plack::Util::Accessor qw( app );
  94         252  
  94         680  
8              
9             sub wrap {
10 202     202 0 5639954 my($self, $app, @args) = @_;
11 202 100       1577 if (ref $self) {
12 3         72 $self->{app} = $app;
13             } else {
14 199         6319 $self = $self->new({ app => $app, @args });
15             }
16 202         1755 return $self->to_app;
17             }
18              
19             1;
20              
21             __END__