File Coverage

lib/Cron/Toolkit/Pattern/List.pm
Criterion Covered Total %
statement 19 19 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 27 30 90.0


line stmt bran cond sub pod time code
1             package Cron::Toolkit::Pattern::List;
2 2     2   25 use strict;
  2         4  
  2         126  
3 2     2   14 use warnings;
  2         4  
  2         120  
4 2     2   13 use parent 'Cron::Toolkit::Pattern';
  2         4  
  2         14  
5              
6             sub type {
7 228     228 0 493 return 'list';
8             }
9              
10             sub match {
11 260     260 0 320 my ($self, $value, $tm) = @_;
12 260 100       233 return scalar (grep { $_->match($value, $tm) } @{ $self->{children} }) ? 1 : 0;
  876         1102  
  260         312  
13             }
14              
15             sub to_english {
16 9     9 0 21 my ($self) = @_;
17 9         14 my @items = map { $_->to_english } @{ $self->{children} };
  27         128  
  9         18  
18 9         47 return join(', ', @items);
19             }
20              
21             1;