File Coverage

blib/lib/Alzabo/Utils.pm
Criterion Covered Total %
statement 6 10 60.0
branch n/a
condition 0 12 0.0
subroutine 2 6 33.3
pod 0 4 0.0
total 8 32 25.0


line stmt bran cond sub pod time code
1             package Alzabo::Utils;
2              
3 12     12   78 use strict;
  12         26  
  12         482  
4              
5 12     12   125 use Scalar::Util qw( blessed reftype );
  12         27  
  12         4431  
6              
7              
8             sub safe_can
9             {
10 0   0 0 0   return blessed( $_[0] ) && $_[0]->can( $_[1] );
11             }
12              
13             sub safe_isa
14             {
15 0   0 0 0   return blessed( $_[0] ) && $_[0]->isa( $_[1] );
16             }
17              
18             sub is_arrayref
19             {
20 0   0 0 0   return defined $_[0] && ref $_[0] && reftype $_[0] eq 'ARRAY';
21             }
22              
23             sub is_hashref
24             {
25 0   0 0 0   return defined $_[0] && ref $_[0] && ( ! blessed $_[0] ) && reftype $_[0] eq 'HASH';
26             }
27              
28              
29             1;
30              
31             __END__