blib/lib/Druid/PostAggregator/Arithmetic.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 21 CC 1 SCAR 6.9
CC
1
Cov
0%
type
2.0
build
2.0
BEGIN
2.0
CRAP 2.0
1 package Druid::PostAggregator::Arithmetic;
2 use Moo;
3  
4 extends 'Druid::PostAggregator';
5  
6 has fn => (is => 'ro');
7 has fields => (is => 'ro', default => sub { [] });
8 has ordering => (is => 'ro', default => 'null');
9  
10 sub type { 'arithmetic' }
11  
12 sub build {
13 my $self = shift;
14  
15 my $aggregation = {
16 'type' => $self->type,
17 'name' => $self->name,
18 'fn' => $self->fn,
19 'fields' => [],
20 'ordering' => $self->ordering,
21 };
22  
23 push @{ $aggregation->{'fields'} }, $_->build
24 for @{ $self->fields };
25  
26 return $aggregation;
27 }
28  
29 1;
30