File Coverage

blib/lib/IBM/StorageSystem/IOGroup.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 4 0.0
condition n/a
subroutine 4 6 66.6
pod 0 1 0.0
total 16 32 50.0


line stmt bran cond sub pod time code
1             package IBM::StorageSystem::IOGroup;
2              
3 1     1   5 use strict;
  1         2  
  1         29  
4 1     1   5 use warnings;
  1         2  
  1         31  
5              
6 1     1   6 use Carp qw(croak);
  1         3  
  1         109  
7              
8             our @ATTR = qw(accessible_vdisk_count compression_active compression_supported
9             flash_copy_free_memory flash_copy_total_memory host_count id maintenance
10             mirroring_free_memory mirroring_total_memory name node_count raid_free_memory
11             raid_total_memory remote_copy_free_memory remote_copy_total_memory vdisk_count);
12              
13             foreach my $attr ( @ATTR ) {
14             {
15 1     1   6 no strict 'refs';
  1         2  
  1         219  
16             *{ __PACKAGE__ .'::'. $attr } = sub {
17 0     0     my( $self, $val ) = @_;
18 0 0         $self->{$attr} = $val if $val;
19 0           return $self->{$attr}
20             }
21             }
22             }
23              
24             sub new {
25 0     0 0   my( $class, $ibm, %args ) = @_;
26 0           my $self = bless {}, $class;
27 0 0         defined $args{'id'} or croak __PACKAGE__
28             . ' constructor failed: mandatory id argument not supplied';
29              
30 0           foreach my $attr ( @ATTR ) { $self->{$attr} = $args{$attr} }
  0            
31              
32 0           return $self
33             }
34              
35             1;
36              
37             __END__