File Coverage

blib/lib/IBM/StorageSystem/Array.pm
Criterion Covered Total %
statement 15 26 57.6
branch 0 6 0.0
condition n/a
subroutine 5 7 71.4
pod 0 1 0.0
total 20 40 50.0


line stmt bran cond sub pod time code
1             package IBM::StorageSystem::Array;
2              
3 1     1   10 use strict;
  1         2  
  1         34  
4 1     1   4 use warnings;
  1         2  
  1         28  
5              
6 1     1   13 use Scalar::Util qw(weaken);
  1         2  
  1         91  
7 1     1   6 use Carp qw(croak);
  1         2  
  1         115  
8              
9             our $VERSION = '0.01';
10             our @ATTR = qw(UID active_WWPN balanced block_size capacity controller_id controller_name
11             ctrl_LUN_no ctrl_WWNN ctrl_type fast_write_state max_path_count mdisk_grp_id mdisk_grp_name
12             mdisk_id mdisk_name mode path_count preferred_WWPN quorum_index raid_level raid_status
13             redundancy spare_goal spare_protection_min status strip_size tier);
14              
15             foreach my $attr ( @ATTR ) {
16             {
17 1     1   6 no strict 'refs';
  1         1  
  1         222  
18             *{ __PACKAGE__ .'::'. $attr } = sub {
19 0     0     my( $self, $val ) = @_;
20 0 0         $val =~ s/\#/no/ if $val;
21 0 0         $self->{$attr} = $val if $val;
22 0           return $self->{$attr}
23             }
24             }
25             }
26              
27             sub new {
28 0     0 0   my( $class, $ibm, %args ) = @_;
29 0           my $self = bless {}, $class;
30 0 0         defined $args{mdisk_id} or croak 'Constructor failed: mandatory mdisk_id argument not supplied';
31 0           weaken( $self->{__ibm} = $ibm );
32              
33 0           foreach my $attr ( @ATTR ) { $self->{$attr} = $args{$attr} }
  0            
34              
35 0           return $self
36             }
37              
38             1;
39              
40             __END__