File Coverage

lib/Rex/Inventory/DMIDecode/Memory.pm
Criterion Covered Total %
statement 19 23 82.6
branch 1 4 25.0
condition 1 3 33.3
subroutine 6 6 100.0
pod 0 2 0.0
total 27 38 71.0


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4              
5             package Rex::Inventory::DMIDecode::Memory;
6              
7 39     39   560 use v5.12.5;
  39         158  
8 39     39   219 use warnings;
  39         89  
  39         1725  
9              
10             our $VERSION = '1.14.2.3'; # TRIAL VERSION
11              
12 39     39   366 use Rex::Inventory::DMIDecode::Section;
  39         118  
  39         2233  
13 39     39   267 use base qw(Rex::Inventory::DMIDecode::Section);
  39         207  
  39         10222  
14              
15             __PACKAGE__->section("Memory Device");
16              
17             __PACKAGE__->has(
18             [
19             'Part Number', 'Serial Number', 'Type', 'Speed',
20             'Size', 'Manufacturer', 'Bank Locator', 'Form Factor',
21             'Locator',
22             ],
23             1
24             ); # is_array 1
25              
26             sub new {
27 3     3 0 7 my $that = shift;
28 3   33     11 my $proto = ref($that) || $that;
29 3         12 my $self = $that->SUPER::new(@_);
30              
31 3         6 bless( $self, $proto );
32              
33 3         9 return $self;
34             }
35              
36             sub get {
37              
38 3     3 0 8 my ( $self, $key, $is_array ) = @_;
39 3 50       10 if ( $key eq "Type" ) {
40 0         0 my $ret = $self->_search_for( $key, $is_array );
41 0 0       0 if ( $ret eq "" ) {
42 0         0 return "";
43             }
44              
45 0         0 return $ret;
46             }
47              
48 3         28 return $self->SUPER::get( $key, $is_array );
49              
50             }
51              
52             1;