File Coverage

blib/lib/App/RemoteCommand/Pool.pm
Criterion Covered Total %
statement 8 34 23.5
branch 0 2 0.0
condition n/a
subroutine 3 8 37.5
pod 0 5 0.0
total 11 49 22.4


line stmt bran cond sub pod time code
1             package App::RemoteCommand::Pool;
2 1     1   607 use v5.24;
  1         6  
3 1     1   4 use warnings;
  1         1  
  1         39  
4 1     1   4 use experimental qw(lexical_subs signatures);
  1         1  
  1         5  
5              
6 0     0 0   sub new ($class) {
  0            
  0            
7 0           bless {
8             pool => [],
9             }, $class;
10             }
11              
12 0     0 0   sub all ($self) {
  0            
  0            
13 0           $self->{pool}->@*;
14             }
15              
16 0     0 0   sub add ($self, $ssh) {
  0            
  0            
  0            
17 0           push $self->{pool}->@*, $ssh;
18 0           $self;
19             }
20              
21 0     0 0   sub remove ($self, $ssh) {
  0            
  0            
  0            
22              
23 0           for my $i (0..$self->{pool}->$#*) {
24 0 0         if ($self->{pool}[$i] eq $ssh) {
25 0           return splice $self->{pool}->@*, $i, 1;
26             }
27             }
28 0           return;
29             }
30              
31 0     0 0   sub count ($self) {
  0            
  0            
32 0           scalar $self->{pool}->@*;
33             }
34              
35             1;