File Coverage

blib/lib/IBM/StorageSystem/Host.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::Host;
2              
3 1     1   6 use strict;
  1         1  
  1         30  
4 1     1   5 use warnings;
  1         2  
  1         26  
5              
6 1     1   7 use Carp qw(croak);
  1         1  
  1         99  
7              
8             our $VERSION = '0.01';
9             our @ATTR = qw(WWPN id iogrp_count mask name node_logged_in_count port_count
10             state status type);
11              
12             foreach my $attr ( @ATTR ) {
13             {
14 1     1   6 no strict 'refs';
  1         2  
  1         226  
15             *{ __PACKAGE__ .'::'. $attr } = sub {
16 0     0     my( $self, $val ) = @_;
        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{'id'} or croak __PACKAGE__
27             . ' constructor failed: mandatory id argument not supplied';
28              
29 0           foreach my $attr ( @ATTR ) { $self->{$attr} = $args{$attr} }
  0            
30              
31 0           return $self
32             }
33              
34             1;
35              
36             __END__