| 1 | # | ||||||||||||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||||||||||||
| 3 | # | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package Rex::Inventory::Proc; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 2 | ▶ | use v5.14.4; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 2 | our $VERSION = '1.16.1'; # VERSION | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 2 | ▶ | use Rex::Inventory::Proc::Cpuinfo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||
| 15 | 2 | my $that = shift; | |||||||||||||||||||
| 16 | 2 | ▶ | 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
| |||||||||||||||||||||
| 17 | 2 | my $self = {@_}; | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 2 | bless( $self, $proto ); | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 2 | $self->_read_proc(); | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 2 | return $self; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 2 | ▶ | sub _read_proc { | ||||||||||||||||||
|
Subroutine
_read_proc: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 27 | 2 | my ($self) = @_; | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 2 | my $p_cpu = Rex::Inventory::Proc::Cpuinfo->new; | |||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 2 | $self->{__proc__} = { cpus => $p_cpu->get, }; | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 1 | ▶ | sub get_cpus { | ||||||||||||||||||
|
Subroutine
get_cpus: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 35 | 1 | my ($self) = @_; | |||||||||||||||||||
| 36 | 1 | return $self->{__proc__}->{cpus}; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 2 | 1; | |||||||||||||||||||