RestApi/SheetsApi4/RangeGroup/Tie/Iterator.pm

filter: Statementstmt 96.6% 29 / 30 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 3 / 3 totaltotal 92.5% 37 / 40 CC 2 SCAR 4.1
CC
2
Cov
94%
iterate
2.0
next
2.0
BEGIN
1.0
CRAP 1.5
« RestApi/Auth.pm ↑ Summary RestApi/GmailApi1/Draft.pm »
1 package Google::RestApi::SheetsApi4::RangeGroup::Tie::Iterator;
2  
3 2 our $VERSION = '2.2.5';
4  
5 2 ▶use Google::RestApi::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use parent qw(Google::RestApi::SheetsApi4::RangeGroup::Iterator);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
10 1 my $class = shift;
11 1 state $check = signature(
12 bless => !!0,
13 named => [
14 tied => HashRef,
15 _extra_ => slurpy HashRef,
16 ],
17 );
18 1 my $p = named_extra($check->(@_));
19  
20 1 my $ptied = delete $p->{tied};
21 1 my $tied = tied(%$ptied);
22  
23 1 my $ranges = $tied->ranges();
24 1 my @keys = keys %$ranges;
25 1 my @values = values %$ranges;
26  
27 1 my $range_group = $tied->spreadsheet()->range_group(@values);
28 1 my $self = $class->SUPER::new(
29 %$p,
30 range_group => $range_group,
31 );
32  
33 1 $self->{keys} = \@keys;
34 1 $self->{tied} = $ptied;
35  
36 1 return bless $self, $class;
37 }
38  
39 2 ▶sub iterate {
Subroutine iterate: called CC=2 SCAR=7.0
Pod documented
40 2 my $self = shift;
41 2 ▶ my $range_group = $self->SUPER::iterate(@_) or return;
Branch: 1 branch
BranchTrueFalseTotal
my $range_group = $self->SUPER::iterate(@_) or return 2 0 2
42  
43 2 my @ranges = $range_group->ranges();
44 my %ranges = map {
45 2 $self->{keys}->[$_] => $ranges[$_];
46 } (0..$#ranges);
47 2 my $tied = tied( %{ $self->{tied} });
48 2 return $tied->default_worksheet()->tie(%ranges);
49 }
50 0 ▶sub next { iterate(@_); }
Subroutine next: not called CC=1 SCAR=6.9
Pod documented
51  
52 2 1;
53  
54 __END__
« RestApi/Auth.pm ↑ Summary RestApi/GmailApi1/Draft.pm »