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   5533 use strict;
  5         13  
  5         118  
4 5     5   24 use warnings;
  5         10  
  5         106  
5              
6 5     5   23 use App::RecordStream::Aggregator::MapReduce;
  5         11  
  5         92  
7              
8 5     5   21 use base 'App::RecordStream::Aggregator::MapReduce';
  5         11  
  5         973  
9              
10             sub new
11             {
12 43     43 0 104 my $class = shift;
13 43         70 my $map = shift;
14 43         81 my $reduce = shift;
15 43         68 my $squish = shift;
16              
17 43         160 my $this =
18             {
19             'map' => $map,
20             'reduce' => $reduce,
21             'squish' => $squish,
22             };
23              
24 43         95 bless $this, $class;
25              
26 43         143 return $this;
27             }
28              
29             sub map
30             {
31 49     49 0 94 my $this = shift;
32              
33 49         170 return $this->{'map'}->(@_);
34             }
35              
36             sub reduce
37             {
38 31     31 0 64 my $this = shift;
39              
40 31         115 return $this->{'reduce'}->(@_);
41             }
42              
43             sub squish
44             {
45 15     15 0 98 my $this = shift;
46              
47 15         68 return $this->{'squish'}->(@_);
48             }
49              
50             1;