File Coverage

blib/lib/IBM/StorageSystem/Fabric.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 4 0.0
condition n/a
subroutine 4 13 30.7
pod 0 1 0.0
total 16 39 41.0


line stmt bran cond sub pod time code
1             package IBM::StorageSystem::Fabric;
2              
3 1     1   6 use strict;
  1         3  
  1         38  
4 1     1   6 use warnings;
  1         1  
  1         30  
5              
6 1     1   6 use Carp qw(croak);
  1         2  
  1         110  
7              
8             our @ATTR = qw(local_wwpn:remote_wwpn remote_wwpn remote_nportid id node_name
9             local_wwpn local_port local_nportid state name cluster_name type);
10              
11             foreach my $attr ( @ATTR ) {
12             {
13 1     1   46 no strict 'refs';
  1         2  
  1         451  
14             *{ __PACKAGE__ .'::'. $attr } = sub {
15 0     0     my( $self, $val ) = @_;
        0      
        0      
        0      
        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{'local_wwpn:remote_wwpn'} or croak __PACKAGE__
26             . ' constructor failed: mandatory local_wwpn:remote_wwpn argument not supplied';
27              
28 0           foreach my $attr ( @ATTR ) { $self->{$attr} = $args{$attr} }
  0            
29              
30 0           return $self
31             }
32              
33             1;
34              
35             __END__