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