File Coverage

blib/lib/App/RecordStream/Aggregator/Records.pm
Criterion Covered Total %
statement 26 29 89.6
branch n/a
condition n/a
subroutine 9 12 75.0
pod 0 6 0.0
total 35 47 74.4


line stmt bran cond sub pod time code
1             package App::RecordStream::Aggregator::Records;
2              
3             our $VERSION = "4.0.25";
4              
5 6     6   68161 use strict;
  6         22  
  6         139  
6 6     6   22 use warnings;
  6         10  
  6         139  
7              
8 6     6   384 use App::RecordStream::Aggregator::MapReduce;
  6         13  
  6         155  
9 6     6   738 use App::RecordStream::Aggregator;
  6         11  
  6         135  
10 6     6   420 use App::RecordStream::DomainLanguage::Registry;
  6         12  
  6         164  
11              
12 6     6   33 use base 'App::RecordStream::Aggregator::MapReduce';
  6         11  
  6         1517  
13              
14             sub new
15             {
16 4     4 0 96 my $class = shift;
17              
18 4         8 my $this =
19             {
20             };
21              
22 4         9 bless $this, $class;
23              
24 4         11 return $this;
25             }
26              
27             sub map
28             {
29 6     6 0 12 my ($this, $record) = @_;
30              
31 6         12 return [$record];
32             }
33              
34             sub reduce
35             {
36 4     4 0 7 my ($this, $cookie1, $cookie2) = @_;
37              
38 4         13 return [@$cookie1, @$cookie2];
39             }
40              
41             sub argct
42             {
43 0     0 0   return 0;
44             }
45              
46             sub short_usage
47             {
48 0     0 0   return "returns an arrayref of all records";
49             }
50              
51             sub long_usage
52             {
53 0     0 0   return <
54             Usage: records
55             An arrayref of all records.
56             EOF
57             }
58              
59             App::RecordStream::Aggregator->register_implementation('records', __PACKAGE__);
60             App::RecordStream::Aggregator->register_implementation('recs', __PACKAGE__);
61              
62             App::RecordStream::DomainLanguage::Registry::register_ctor(__PACKAGE__, 'records');
63             App::RecordStream::DomainLanguage::Registry::register_ctor(__PACKAGE__, 'recs');
64              
65             1;