| 1 | # | ||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||
| 3 | # | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package Rex::Inventory::DMIDecode::Memory; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 40 | ▶ | use v5.14.4; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 40 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 40 | our $VERSION = '1.16.1'; # VERSION | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 40 | ▶ | use Rex::Inventory::DMIDecode::Section; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 40 | ▶ | use base qw(Rex::Inventory::DMIDecode::Section); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 40 | __PACKAGE__->section("Memory Device"); | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 40 | __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 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||
| 27 | 3 | my $that = shift; | |||||||||||||||||||
| 28 | 3 | ▶ | my $proto = ref($that) || $that; | ||||||||||||||||||
|
Condition33%1/3
ref $that || $that
MC/DC0%0/2
ref $that || $that
ref $that
$that
Truth table33%1/3
A || B
A= ref $thatB= $that
| |||||||||||||||||||||
| 29 | 3 | my $self = $that->SUPER::new(@_); | |||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 3 | bless( $self, $proto ); | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 3 | return $self; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 3 | ▶ | sub get { | ||||||||||||||||||
|
Subroutine
get: called CC=3 SCAR=16.7
Pod
undocumented
| |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 3 | my ( $self, $key, $is_array ) = @_; | |||||||||||||||||||
| 39 | 3 | ▶ | if ( $key eq "Type" ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 40 | 0 | my $ret = $self->_search_for( $key, $is_array ); | |||||||||||||||||||
| 41 | 0 | ▶ | if ( $ret eq "<OUT OF SPEC>" ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 42 | 0 | return ""; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 0 | return $ret; | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 3 | return $self->SUPER::get( $key, $is_array ); | |||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 40 | 1; | |||||||||||||||||||