/
First.pm
43 lines (30 loc) · 826 Bytes
/
First.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package App::RecordStream::Aggregator::First;
our $VERSION = "4.0.4";
use strict;
use warnings;
use App::RecordStream::Aggregator::InjectInto::Field;
use App::RecordStream::DomainLanguage::Registry;
use base qw(App::RecordStream::Aggregator::InjectInto::Field);
#sub new -- passed through
#sub new_from_valuation -- passed through
sub combine_field
{
my $this = shift;
my $cookie = shift;
my $value = shift;
return defined($cookie) ? $cookie : $value;
}
sub short_usage
{
return "first value for a field";
}
sub long_usage
{
return <<EOF;
Usage: first,<field>
First value of specified field.
EOF
}
App::RecordStream::Aggregator->register_implementation('first', __PACKAGE__);
App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'first', 'VALUATION');
1;