File Coverage

blib/lib/App/RecordStream/Stream/Sub.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 3 0.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             package App::RecordStream::Stream::Sub;
2              
3 2     2   10 use App::RecordStream::Stream::Base;
  2         4  
  2         50  
4              
5 2     2   8 use base 'App::RecordStream::Stream::Base';
  2         3  
  2         323  
6              
7             sub new
8             {
9 8     8 0 16 my $class = shift;
10 8         11 my $record_sub = shift;
11 8         11 my $line_sub = shift;
12              
13 8         32 my $this = $class->SUPER::new();
14              
15 8         20 $this->{'RECORD_SUB'} = $record_sub;
16 8         14 $this->{'LINE_SUB'} = $line_sub;
17              
18 8         11 bless $this, $class;
19              
20 8         19 return $this;
21             }
22              
23             sub accept_record
24             {
25 14     14 0 23 my $this = shift;
26 14         19 my $record = shift;
27              
28 14         31 return $this->{'RECORD_SUB'}->($record);
29             }
30              
31             sub accept_line
32             {
33 8     8 0 13 my $this = shift;
34 8         10 my $line = shift;
35              
36 8         22 return $this->{'LINE_SUB'}->($line);
37             }
38              
39             1;