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   8 use strictures;
  1         2  
  1         9  
4 1     1   656 use parent 'Exporter::Tiny';
  1         3  
  1         7  
5              
6 1     1   961 use Web::ComposableRequest::Exception;
  1         5  
  1         50  
7 1     1   10 use Role::Tiny ();
  1         2  
  1         333  
8              
9             our @EXPORT = qw( COMMA EXCEPTION_CLASS FALSE LANG NUL SPC TRUE );
10              
11             my $Exception_Class = 'Web::ComposableRequest::Exception';
12              
13             sub COMMA () { q(,) }
14             sub FALSE () { 0 }
15             sub LANG () { 'en' }
16             sub NUL () { q() }
17             sub SPC () { q( ) }
18             sub TRUE () { 1 }
19              
20 2     2 1 55 sub EXCEPTION_CLASS () { __PACKAGE__->Exception_Class }
21              
22             sub Exception_Class {
23 6 100   6 1 1229 my ($self, $class) = @_; defined $class or return $Exception_Class;
  6         32  
24              
25 2 100       44 $class->can( 'throw' ) or $Exception_Class->throw
26             ( "Exception class ${class} is not loaded or has no throw method" );
27              
28 1         3 return $Exception_Class = $class;
29             }
30              
31             1;
32              
33             __END__