| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package IBM::StorageSystem::Drive; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 6 | use strict; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 34 |  | 
| 4 | 1 |  |  | 1 |  | 4 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 25 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 1 |  |  | 1 |  | 4 | use Carp qw(croak); | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 111 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | our $VERSION = '0.01'; | 
| 9 |  |  |  |  |  |  | our @ATTR = qw(id status error_sequence_number use UID tech_type capacity block_size | 
| 10 |  |  |  |  |  |  | vendor_id product_id FRU_part_number FRU_identity RPM firmware_level FPGA_level | 
| 11 |  |  |  |  |  |  | mdisk_id mdisk_name member_id enclosure_id slot_id node_id node_name quorum_id | 
| 12 |  |  |  |  |  |  | port_1_status port_2_status); | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | foreach my $attr ( @ATTR ) { | 
| 15 |  |  |  |  |  |  | { | 
| 16 | 1 |  |  | 1 |  | 6 | no strict 'refs'; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 210 |  | 
| 17 |  |  |  |  |  |  | *{ __PACKAGE__ .'::'. $attr } = sub { | 
| 18 | 0 |  |  | 0 |  |  | my( $self, $val ) = @_; | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
|  |  |  |  | 0 |  |  |  | 
| 19 | 0 | 0 |  |  |  |  | $self->{$attr} = $val if $val; | 
| 20 | 0 |  |  |  |  |  | return $self->{$attr} | 
| 21 |  |  |  |  |  |  | } | 
| 22 |  |  |  |  |  |  | } | 
| 23 |  |  |  |  |  |  | } | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | sub new { | 
| 26 | 0 |  |  | 0 | 0 |  | my( $class, $ibm, %args ) = @_; | 
| 27 | 0 |  |  |  |  |  | my $self = bless {}, $class; | 
| 28 | 0 | 0 |  |  |  |  | defined $args{id} or croak '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__ |