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   26 use strict;
  4         11  
  4         114  
4 4     4   24 use warnings;
  4         11  
  4         1177  
5              
6             sub new
7             {
8 192     192 0 496 my $class = shift;
9 192         337 my $next = shift;
10 192         331 my $bucket = shift;
11 192         346 my $name = shift;
12 192         20211 my $value = shift;
13              
14 192         883 my $this =
15             {
16             'next' => $next,
17             'bucket' => $bucket,
18             'name' => $name,
19             'value' => $value,
20             };
21 192         810 bless $this, $class;
22              
23 192         605 return $this;
24             }
25              
26             sub key_clumper_callback_begin
27             {
28 34     34 0 67 my $this = shift;
29              
30 34         93 $this->key_clumper_callback_begin_value($this->{'value'});
31             }
32              
33             sub key_clumper_callback_begin_value
34             {
35 83     83 0 153 my $this = shift;
36 83         156 my $value = shift;
37              
38 83         175 my $name = $this->{'name'};
39 83         155 my $bucket = $this->{'bucket'};
40 83 50       222 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         456 return $this->{'next'}->clumper_callback_begin({%$bucket, $name => $value});
46             }
47              
48             sub key_clumper_callback_push_record
49             {
50 191     191 0 365 my $this = shift;
51 191         539 my $cookie = shift;
52 191         372 my $record = shift;
53              
54 191         610 $this->{'next'}->clumper_callback_push_record($cookie, $record);
55             }
56              
57             sub key_clumper_callback_end
58             {
59 83     83 0 164 my $this = shift;
60 83         147 my $cookie = shift;
61              
62 83         426 $this->{'next'}->clumper_callback_end($cookie);
63             }
64              
65             1;