| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package App::RecordStream::Deaggregator::Unarray; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 529 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 24 |  | 
| 4 | 1 |  |  | 1 |  | 4 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 20 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 1 |  |  | 1 |  | 5 | use App::RecordStream::Deaggregator::Field; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 16 |  | 
| 7 | 1 |  |  | 1 |  | 4 | use App::RecordStream::Deaggregator; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 14 |  | 
| 8 | 1 |  |  | 1 |  | 4 | use App::RecordStream::DomainLanguage::Registry; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 21 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 1 |  |  | 1 |  | 5 | use base 'App::RecordStream::Deaggregator::Field'; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 238 |  | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | sub new | 
| 13 |  |  |  |  |  |  | { | 
| 14 | 1 |  |  | 1 | 0 | 4 | my $class = shift; | 
| 15 | 1 |  |  |  |  | 4 | my $old_field = shift; | 
| 16 | 1 |  |  |  |  | 2 | my $new_field = shift; | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 1 |  |  |  |  | 12 | my $this = $class->SUPER::new($old_field); | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 1 |  |  |  |  | 10 | $this->{'new_field'} = $new_field; | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 1 |  |  |  |  | 9 | return $this; | 
| 23 |  |  |  |  |  |  | } | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | sub new_from_valuation | 
| 26 |  |  |  |  |  |  | { | 
| 27 | 0 |  |  | 0 | 0 | 0 | my $class = shift; | 
| 28 | 0 |  |  |  |  | 0 | my $valuation = shift; | 
| 29 | 0 |  |  |  |  | 0 | my $new_field = shift; | 
| 30 |  |  |  |  |  |  |  | 
| 31 | 0 |  |  |  |  | 0 | my $this = $class->SUPER::new_from_valuation($valuation); | 
| 32 |  |  |  |  |  |  |  | 
| 33 | 0 |  |  |  |  | 0 | $this->{'new_field'} = $new_field; | 
| 34 |  |  |  |  |  |  |  | 
| 35 | 0 |  |  |  |  | 0 | return $this; | 
| 36 |  |  |  |  |  |  | } | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  | sub deaggregate_field | 
| 39 |  |  |  |  |  |  | { | 
| 40 | 1 |  |  | 1 | 0 | 2 | my $this = shift; | 
| 41 | 1 |  |  |  |  | 3 | my $values = shift; | 
| 42 |  |  |  |  |  |  |  | 
| 43 | 1 |  |  |  |  | 2 | my @ret; | 
| 44 |  |  |  |  |  |  |  | 
| 45 | 1 |  |  |  |  | 2 | for my $value (@$values) | 
| 46 |  |  |  |  |  |  | { | 
| 47 | 3 |  |  |  |  | 9 | push @ret, {$this->{'new_field'} => $value}; | 
| 48 |  |  |  |  |  |  | } | 
| 49 |  |  |  |  |  |  |  | 
| 50 | 1 |  |  |  |  | 4 | return \@ret; | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | sub long_usage | 
| 54 |  |  |  |  |  |  | { | 
| 55 | 0 |  |  | 0 | 0 | 0 | return < | 
| 56 |  |  |  |  |  |  | Usage: unarray,, | 
| 57 |  |  |  |  |  |  | Split the array into individual \"element\" records | 
| 58 |  |  |  |  |  |  | EOF | 
| 59 |  |  |  |  |  |  | } | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | sub short_usage | 
| 62 |  |  |  |  |  |  | { | 
| 63 | 0 |  |  | 0 | 0 | 0 | return "split the provided array"; | 
| 64 |  |  |  |  |  |  | } | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | sub argct | 
| 67 |  |  |  |  |  |  | { | 
| 68 | 1 |  |  | 1 | 0 | 4 | return 2; | 
| 69 |  |  |  |  |  |  | } | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | App::RecordStream::Deaggregator->register_implementation('unarray', __PACKAGE__); | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'unarray', 'VALUATION', 'SCALAR'); | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | 1; |