File Coverage

blib/lib/App/RecordStream/Aggregator/First.pm
Criterion Covered Total %
statement 19 21 90.4
branch 2 2 100.0
condition n/a
subroutine 6 8 75.0
pod 0 3 0.0
total 27 34 79.4


line stmt bran cond sub pod time code
1             package App::RecordStream::Aggregator::First;
2              
3             our $VERSION = "4.0.23";
4              
5 6     6   3256 use strict;
  6         15  
  6         140  
6 6     6   29 use warnings;
  6         12  
  6         126  
7              
8 6     6   349 use App::RecordStream::Aggregator::InjectInto::Field;
  6         13  
  6         108  
9 6     6   30 use App::RecordStream::DomainLanguage::Registry;
  6         12  
  6         106  
10              
11 6     6   26 use base qw(App::RecordStream::Aggregator::InjectInto::Field);
  6         13  
  6         1205  
12              
13             #sub new -- passed through
14              
15             #sub new_from_valuation -- passed through
16              
17             sub combine_field
18             {
19 72     72 0 119 my $this = shift;
20 72         118 my $cookie = shift;
21 72         113 my $value = shift;
22              
23 72 100       283 return defined($cookie) ? $cookie : $value;
24             }
25              
26             sub short_usage
27             {
28 0     0 0   return "first value for a field";
29             }
30              
31             sub long_usage
32             {
33 0     0 0   return <
34             Usage: first,
35             First value of specified field.
36             EOF
37             }
38              
39             App::RecordStream::Aggregator->register_implementation('first', __PACKAGE__);
40              
41             App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'first', 'VALUATION');
42              
43             1;