File Coverage

blib/lib/IBM/StorageSystem/Replication.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 4 0.0
condition n/a
subroutine 4 10 40.0
pod 0 1 0.0
total 16 36 44.4


line stmt bran cond sub pod time code
1             package IBM::StorageSystem::Replication;
2              
3 1     1   7 use strict;
  1         2  
  1         42  
4 1     1   6 use warnings;
  1         2  
  1         29  
5              
6 1     1   5 use Carp qw(croak);
  1         2  
  1         105  
7              
8             our $VERSION = '0.01';
9             our @ATTR = qw(filesystem log_Id status description time);
10              
11             foreach my $attr ( map lc, @ATTR ) {
12             {
13 1     1   10 no strict 'refs';
  1         2  
  1         221  
14             *{ __PACKAGE__ .'::'. $attr } = sub {
15 0     0     my( $self, $val ) = @_;
        0      
        0      
        0      
        0      
16 0 0         $self->{$attr} = $val if $val;
17 0           return $self->{$attr}
18             }
19             }
20             }
21              
22             sub new {
23 0     0 0   my( $class, $ibm, %args ) = @_;
24 0           my $self = bless {}, $class;
25 0 0         defined $args{'log_Id'} or croak __PACKAGE__
26             . ' constructor failed: mandatory log_Id argument not supplied';
27              
28 0           foreach my $attr ( @ATTR ) { $self->{lc $attr} = $args{$attr} }
  0            
29              
30 0           return $self
31             }
32              
33             1;
34              
35             __END__