File Coverage

lib/Web/ComposableRequest/Constants.pm
Criterion Covered Total %
statement 17 17 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 29 29 100.0


line stmt bran cond sub pod time code
1             package Web::ComposableRequest::Constants;
2              
3 1     1   4 use strictures;
  1         0  
  1         7  
4 1     1   169 use parent 'Exporter::Tiny';
  1         1  
  1         4  
5              
6 1     1   707 use Web::ComposableRequest::Exception;
  1         1  
  1         27  
7 1     1   5 use Role::Tiny ();
  1         1  
  1         172  
8              
9             our @EXPORT = qw( EXCEPTION_CLASS FALSE LANG NUL TRUE );
10              
11             my $Exception_Class = 'Web::ComposableRequest::Exception';
12              
13             sub FALSE () { 0 }
14             sub LANG () { 'en' }
15             sub NUL () { q() }
16             sub TRUE () { 1 }
17              
18 2     2 1 48 sub EXCEPTION_CLASS () { __PACKAGE__->Exception_Class }
19              
20             sub Exception_Class {
21 6 100   6 1 526 my ($self, $class) = @_; defined $class or return $Exception_Class;
  6         24  
22              
23 2 100       33 $class->can( 'throw' ) or $Exception_Class->throw
24             ( "Exception class ${class} is not loaded or has no throw method" );
25              
26 1         3 return $Exception_Class = $class;
27             }
28              
29             1;
30              
31             __END__