File Coverage

blib/lib/Error/Tiny/Then.pm
Criterion Covered Total %
statement 14 14 100.0
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 0 2 0.0
total 19 22 86.3


line stmt bran cond sub pod time code
1             package Error::Tiny::Then;
2              
3 1     1   4 use strict;
  1         2  
  1         22  
4 1     1   10 use warnings;
  1         2  
  1         98  
5              
6             require Carp;
7              
8             sub new {
9 4     4 0 9 my $class = shift;
10 4         14 my (%params) = @_;
11              
12 4         11 my $self = {};
13 4         14 bless $self, $class;
14              
15 4         26 $self->{handler} = $params{handler};
16              
17 4 50       19 Carp::croak('handler is required') unless $self->{handler};
18              
19 4         563 return $self;
20             }
21              
22 4     4 0 25 sub handler { $_[0]->{handler} }
23              
24             1;