File Coverage

blib/lib/IBM/StorageSystem/Snapshot.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 4 0.0
condition n/a
subroutine 4 14 28.5
pod 0 1 0.0
total 16 40 40.0


line stmt bran cond sub pod time code
1             package IBM::StorageSystem::Snapshot;
2              
3 1     1   6 use strict;
  1         2  
  1         37  
4 1     1   5 use warnings;
  1         3  
  1         32  
5              
6 1     1   6 use Carp qw(croak);
  1         1  
  1         105  
7              
8             our @ATTR = qw(Device_name Fileset_name Snapshot_ID Rule_Name Status Creation Used_metadata Used_data ID Timestamp);
9              
10             foreach my $attr ( map lc, @ATTR ) {
11             {
12 1     1   6 no strict 'refs';
  1         3  
  1         233  
13             *{ __PACKAGE__ .'::'. $attr } = sub {
14 0     0     my( $self, $val ) = @_;
        0      
        0      
        0      
        0      
        0      
        0      
        0      
        0      
15 0 0         $self->{$attr} = $val if $val;
16 0           return $self->{$attr}
17             }
18             }
19             }
20              
21             sub new {
22 0     0 0   my( $class, $ibm, %args ) = @_;
23 0           my $self = bless {}, $class;
24 0 0         defined $args{'Snapshot_ID'} or croak __PACKAGE__
25             . ' constructor failed: mandatory Snapshot_ID parameter missing';
26              
27 0           foreach my $attr ( @ATTR ) { $self->{lc $attr} = $args{$attr} }
  0            
28              
29 0           return $self
30             }
31              
32             1;
33              
34             __END__