File Coverage

blib/lib/IBM/StorageSystem/Task.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 4 0.0
condition n/a
subroutine 4 14 28.5
pod 0 1 0.0
total 16 40 40.0


line stmt bran cond sub pod time code
1             package IBM::StorageSystem::Task;
2              
3 1     1   5 use strict;
  1         1  
  1         28  
4 1     1   4 use warnings;
  1         2  
  1         22  
5              
6 1     1   5 use Carp qw(croak);
  1         1  
  1         90  
7              
8             our $VERSION = '0.01';
9             our @ATTR = qw(Name Description Status Last_run Runs_on Type Scheduled Second
10             Minute Hour DayOfMonth Month DayOfWeek Parameter);
11              
12             foreach my $attr ( map lc, @ATTR ) {
13             {
14 1     1   5 no strict 'refs';
  1         1  
  1         191  
15             *{ __PACKAGE__ .'::'. $attr } = sub {
16 0     0     my( $self, $val ) = @_;
        0      
        0      
        0      
        0      
        0      
        0      
        0      
        0      
17 0 0         $self->{$attr} = $val if $val;
18 0           return $self->{$attr}
19             }
20             }
21             }
22              
23             sub new {
24 0     0 0   my( $class, $ibm, %args ) = @_;
25 0           my $self = bless {}, $class;
26 0 0         defined $args{'Name'} or croak __PACKAGE__
27             . ' constructor failed: mandatory Name argument not supplied';
28              
29 0           foreach my $attr ( @ATTR ) { $self->{lc $attr} = $args{$attr} }
  0            
30              
31 0           return $self
32             }
33              
34             1;
35              
36             __END__