File Coverage

blib/lib/Petal/Utils/Keys.pm
Criterion Covered Total %
statement 24 24 100.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 7 7 100.0
pod 0 1 0.0
total 33 37 89.1


line stmt bran cond sub pod time code
1             package Petal::Utils::Keys;
2              
3 1     1   8 use strict;
  1         20  
  1         53  
4 1     1   5 use warnings::register;
  1         1  
  1         157  
5              
6 1     1   6 use Carp;
  1         2  
  1         82  
7              
8 1     1   5 use base qw( Petal::Utils::Base );
  1         1  
  1         122  
9              
10 1     1   6 use constant name => 'keys';
  1         1  
  1         63  
11 1     1   5 use constant aliases => qw();
  1         2  
  1         229  
12              
13             our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1];
14             our $REVISION = (split(/ /, ' $Revision: 1.2 $ '))[2];
15              
16             sub process {
17 1     1 0 981 my $class = shift;
18 1         3 my $hash = shift;
19 1   33     6 my $args = shift || confess( "'keys' expects a hash ref (got nothing)!" );
20              
21 1         6 my $result = $hash->fetch( $args );
22              
23 1 50       74 confess( "1st arg to 'keys' is not a hash ($args = $result)!" )
24             unless ref($result) eq 'HASH'; # ignore object for now
25              
26 1         9 return [ keys %$result ];
27             }
28              
29              
30             1;
31              
32             __END__