File Coverage

blib/lib/App/RecordStream/Aggregator/FirstRecord.pm
Criterion Covered Total %
statement 21 23 91.3
branch 2 2 100.0
condition n/a
subroutine 7 9 77.7
pod 0 4 0.0
total 30 38 78.9


line stmt bran cond sub pod time code
1             package App::RecordStream::Aggregator::FirstRecord;
2              
3             our $VERSION = "4.0.24";
4              
5 5     5   2643 use strict;
  5         12  
  5         137  
6 5     5   30 use warnings;
  5         10  
  5         135  
7              
8 5     5   30 use App::RecordStream::Aggregator::InjectInto;
  5         11  
  5         119  
9 5     5   126 use App::RecordStream::DomainLanguage::Registry;
  5         14  
  5         182  
10              
11 5     5   35 use base qw(App::RecordStream::Aggregator::InjectInto);
  5         13  
  5         948  
12              
13             sub combine
14             {
15 2     2 0 3 my $this = shift;
16 2         4 my $cookie = shift;
17 2         2 my $record = shift;
18              
19 2 100       7 return $record unless ( defined $cookie );
20              
21 1         2 return $cookie;
22             }
23              
24             sub short_usage
25             {
26 0     0 0 0 return "first record";
27             }
28              
29             sub long_usage
30             {
31 0     0 0 0 return <
32             Usage: first
33             Returns the first record.
34             EOF
35             }
36              
37             sub argct
38             {
39 1     1 0 3 return 0;
40             }
41              
42             App::RecordStream::Aggregator->register_implementation('firstrecord', __PACKAGE__);
43             App::RecordStream::Aggregator->register_implementation('firstrec', __PACKAGE__);
44              
45             App::RecordStream::DomainLanguage::Registry::register_ctor(__PACKAGE__, 'firstrecord');
46             App::RecordStream::DomainLanguage::Registry::register_ctor(__PACKAGE__, 'firstrec');
47              
48             1;