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   12 use App::RecordStream::Stream::Base;
  2         4  
  2         52  
4              
5 2     2   9 use base 'App::RecordStream::Stream::Base';
  2         4  
  2         305  
6              
7             sub new
8             {
9 8     8 0 19 my $class = shift;
10 8         15 my $record_sub = shift;
11 8         13 my $line_sub = shift;
12              
13 8         45 my $this = $class->SUPER::new();
14              
15 8         20 $this->{'RECORD_SUB'} = $record_sub;
16 8         20 $this->{'LINE_SUB'} = $line_sub;
17              
18 8         14 bless $this, $class;
19              
20 8         21 return $this;
21             }
22              
23             sub accept_record
24             {
25 14     14 0 27 my $this = shift;
26 14         20 my $record = shift;
27              
28 14         42 return $this->{'RECORD_SUB'}->($record);
29             }
30              
31             sub accept_line
32             {
33 8     8 0 13 my $this = shift;
34 8         13 my $line = shift;
35              
36 8         24 return $this->{'LINE_SUB'}->($line);
37             }
38              
39             1;