File Coverage

blib/lib/App/RecordStream/Deaggregator/Field.pm
Criterion Covered Total %
statement 28 28 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 3 0.0
total 36 39 92.3


line stmt bran cond sub pod time code
1             package App::RecordStream::Deaggregator::Field;
2              
3 1     1   6 use strict;
  1         2  
  1         25  
4 1     1   5 use warnings;
  1         2  
  1         23  
5              
6 1     1   273 use App::RecordStream::Deaggregator::Base;
  1         3  
  1         42  
7 1     1   8 use App::RecordStream::DomainLanguage::Valuation::KeySpec;
  1         3  
  1         45  
8              
9 1     1   10 use base 'App::RecordStream::Deaggregator::Base';
  1         3  
  1         323  
10              
11             sub new
12             {
13 7     7 0 23 my $class = shift;
14 7         19 my $field = shift;
15              
16 7         94 return new_from_valuation($class, App::RecordStream::DomainLanguage::Valuation::KeySpec->new($field));
17             }
18              
19             sub new_from_valuation
20             {
21 7     7 0 24 my $class = shift;
22 7         18 my $valuation = shift;
23              
24 7         27 my $this =
25             {
26             'valuation' => $valuation,
27             };
28 7         22 bless $this, $class;
29              
30 7         28 return $this;
31             }
32              
33             sub deaggregate
34             {
35 17     17 0 36 my $this = shift;
36 17         33 my $record = shift;
37              
38 17         38 my $valuation = $this->{'valuation'};
39              
40 17         68 my $value = $valuation->evaluate_record($record);
41              
42 17         81 return $this->deaggregate_field($value);
43             }
44              
45             1;