File Coverage

blib/lib/P9Y/ProcessTable/Table/Base.pm
Criterion Covered Total %
statement 30 30 100.0
branch 4 4 100.0
condition 2 3 66.6
subroutine 9 9 100.0
pod 0 2 0.0
total 45 48 93.7


line stmt bran cond sub pod time code
1             package P9Y::ProcessTable::Table::Base;
2              
3             our $AUTHORITY = 'cpan:BBYRD'; # AUTHORITY
4             our $VERSION = '1.07'; # VERSION
5              
6             #############################################################################
7             # Modules
8              
9             # use sanity;
10 3     3   2699 use strict qw(subs vars);
  3         8  
  3         208  
11 3     3   17 no strict 'refs';
  3         6  
  3         161  
12 3     3   16 use warnings FATAL => 'all';
  3         7  
  3         137  
13 3     3   16 no warnings qw(uninitialized);
  3         7  
  3         98  
14              
15 3     3   17 use Moo;
  3         6  
  3         21  
16              
17 3     3   979 use namespace::clean;
  3         8  
  3         45  
18 3     3   1746 no warnings 'uninitialized';
  3         7  
  3         763  
19              
20             #############################################################################
21             # Common Methods (may potentially be overloaded with OS-specific ones)
22              
23             sub table {
24 1     1 0 3 my $self = shift;
25 1         8 return map { $self->process($_) } ($self->list);
  10         11964  
26             }
27              
28             sub process {
29 13     13 0 49 my ($self, $pid) = @_;
30 13 100       66 $pid = $$ if (@_ == 1);
31 13         94 my $hash = $self->_process_hash($pid);
32 13 100 66     180 return unless $hash && $hash->{pid};
33              
34 12         39 $hash->{_pt_obj} = $self;
35 12         442 return P9Y::ProcessTable::Process->new($hash);
36             }
37              
38             42;