blib/lib/Iterator/Flex/Role/Exhaustion/Return.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 2 / 2 totaltotal 100% 40 / 40 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Iterator/Flex/Role/Exhaustion/ImportedThrow.pm ↑ Summary blib/lib/Iterator/Flex/Role/Prev/Closure.pm »
1 package Iterator::Flex::Role::Exhaustion::Return;
2  
3 # ABSTRACT: signal exhaustion by returning a sentinel value.
4  
5 30 ▶use v5.28;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 30 our $VERSION = '0.33';
10  
11 30 ▶use Scalar::Util();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 30 ▶use Iterator::Flex::Utils qw[ :default REG_GENERAL REG_GP_EXHAUSTION ];
Subroutine BEGIN: called CC=1 SCAR=0.0
13 30 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 30 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 30 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19  
20  
21  
22  
23  
24  
25  
26 ▶sub sentinel ( $self ) {
Subroutine sentinel: called CC=1 SCAR=0.0
Pod documented
27 466 return $REGISTRY{ refaddr $self }[REG_GENERAL][REG_GP_EXHAUSTION][1];
28 }
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39 ▶sub signal_exhaustion ( $self, @ ) {
Subroutine signal_exhaustion: called CC=1 SCAR=0.0
Pod documented
40 465 $self->set_exhausted;
41 465 return $self->sentinel;
42 }
43  
44  
45 30 1;
46  
47 #
48 # This file is part of Iterator-Flex
49 #
50 # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
51 #
52 # This is free software, licensed under:
53 #
54 # The GNU General Public License, Version 3, June 2007
55 #
56  
57 __END__
« blib/lib/Iterator/Flex/Role/Exhaustion/ImportedThrow.pm ↑ Summary blib/lib/Iterator/Flex/Role/Prev/Closure.pm »