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.23";
4              
5 6     6   24146 use strict;
  6         14  
  6         143  
6 6     6   28 use warnings;
  6         12  
  6         129  
7              
8 6     6   2385 use App::RecordStream::Aggregator::MapReduce;
  6         15  
  6         126  
9 6     6   363 use App::RecordStream::Aggregator;
  6         15  
  6         133  
10 6     6   584 use App::RecordStream::DomainLanguage::Registry;
  6         14  
  6         129  
11              
12 6     6   77 use base 'App::RecordStream::Aggregator::MapReduce';
  6         15  
  6         1198  
13              
14             sub new
15             {
16 4     4 0 24 my $class = shift;
17              
18 4         11 my $this =
19             {
20             };
21              
22 4         10 bless $this, $class;
23              
24 4         14 return $this;
25             }
26              
27             sub map
28             {
29 6     6 0 14 my ($this, $record) = @_;
30              
31 6         82 return [$record];
32             }
33              
34             sub reduce
35             {
36 4     4 0 10 my ($this, $cookie1, $cookie2) = @_;
37              
38 4         14 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;