File Coverage

blib/lib/App/RecordStream/Aggregator/MapReduce/Subrefs.pm
Criterion Covered Total %
statement 25 25 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 4 0.0
total 33 37 89.1


line stmt bran cond sub pod time code
1             package App::RecordStream::Aggregator::MapReduce::Subrefs;
2              
3 5     5   4283 use strict;
  5         11  
  5         120  
4 5     5   20 use warnings;
  5         9  
  5         127  
5              
6 5     5   23 use App::RecordStream::Aggregator::MapReduce;
  5         24  
  5         118  
7              
8 5     5   22 use base 'App::RecordStream::Aggregator::MapReduce';
  5         21  
  5         1113  
9              
10             sub new
11             {
12 43     43 0 77 my $class = shift;
13 43         62 my $map = shift;
14 43         62 my $reduce = shift;
15 43         62 my $squish = shift;
16              
17 43         144 my $this =
18             {
19             'map' => $map,
20             'reduce' => $reduce,
21             'squish' => $squish,
22             };
23              
24 43         82 bless $this, $class;
25              
26 43         144 return $this;
27             }
28              
29             sub map
30             {
31 49     49 0 76 my $this = shift;
32              
33 49         145 return $this->{'map'}->(@_);
34             }
35              
36             sub reduce
37             {
38 31     31 0 67 my $this = shift;
39              
40 31         94 return $this->{'reduce'}->(@_);
41             }
42              
43             sub squish
44             {
45 15     15 0 102 my $this = shift;
46              
47 15         67 return $this->{'squish'}->(@_);
48             }
49              
50             1;