File Coverage

blib/lib/App/RecordStream/Clumper/Key/WrappedCallback.pm
Criterion Covered Total %
statement 29 30 96.6
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 0 5 0.0
total 37 44 84.0


line stmt bran cond sub pod time code
1             package App::RecordStream::Clumper::Key::WrappedCallback;
2              
3 4     4   19 use strict;
  4         7  
  4         83  
4 4     4   14 use warnings;
  4         6  
  4         980  
5              
6             sub new
7             {
8 192     192 0 276 my $class = shift;
9 192         237 my $next = shift;
10 192         236 my $bucket = shift;
11 192         252 my $name = shift;
12 192         248 my $value = shift;
13              
14 192         577 my $this =
15             {
16             'next' => $next,
17             'bucket' => $bucket,
18             'name' => $name,
19             'value' => $value,
20             };
21 192         324 bless $this, $class;
22              
23 192         348 return $this;
24             }
25              
26             sub key_clumper_callback_begin
27             {
28 34     34 0 49 my $this = shift;
29              
30 34         61 $this->key_clumper_callback_begin_value($this->{'value'});
31             }
32              
33             sub key_clumper_callback_begin_value
34             {
35 83     83 0 119 my $this = shift;
36 83         115 my $value = shift;
37              
38 83         133 my $name = $this->{'name'};
39 83         373 my $bucket = $this->{'bucket'};
40 83 50       152 if(!defined($bucket))
41             {
42 0         0 die "clumper_callback_begin() called in bucketless position (did you call begin() in your end()?)";
43             }
44              
45 83         395 return $this->{'next'}->clumper_callback_begin({%$bucket, $name => $value});
46             }
47              
48             sub key_clumper_callback_push_record
49             {
50 191     191 0 274 my $this = shift;
51 191         241 my $cookie = shift;
52 191         247 my $record = shift;
53              
54 191         473 $this->{'next'}->clumper_callback_push_record($cookie, $record);
55             }
56              
57             sub key_clumper_callback_end
58             {
59 83     83 0 125 my $this = shift;
60 83         102 my $cookie = shift;
61              
62 83         198 $this->{'next'}->clumper_callback_end($cookie);
63             }
64              
65             1;