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.08'; # VERSION
5              
6             #############################################################################
7             # Modules
8              
9             # use sanity;
10 3     3   2041 use strict qw(subs vars);
  3         5  
  3         98  
11 3     3   16 no strict 'refs';
  3         4  
  3         76  
12 3     3   15 use warnings FATAL => 'all';
  3         7  
  3         109  
13 3     3   15 no warnings qw(uninitialized);
  3         3  
  3         87  
14              
15 3     3   14 use Moo;
  3         6  
  3         18  
16              
17 3     3   946 use namespace::clean;
  3         5  
  3         28  
18 3     3   616 no warnings 'uninitialized';
  3         6  
  3         521  
19              
20             #############################################################################
21             # Common Methods (may potentially be overloaded with OS-specific ones)
22              
23             sub table {
24 1     1 0 2 my $self = shift;
25 1         7 return map { $self->process($_) } ($self->list);
  10         10289  
26             }
27              
28             sub process {
29 13     13 0 37 my ($self, $pid) = @_;
30 13 100       73 $pid = $$ if (@_ == 1);
31 13         67 my $hash = $self->_process_hash($pid);
32 13 100 66     142 return unless $hash && $hash->{pid};
33              
34 12         30 $hash->{_pt_obj} = $self;
35 12         364 return P9Y::ProcessTable::Process->new($hash);
36             }
37              
38             42;