File Coverage

blib/lib/Iterator/Flex/Role/Current/Closure.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 1 1 100.0
total 33 33 100.0


line stmt bran cond sub pod time code
1             package Iterator::Flex::Role::Current::Closure;
2              
3             # ABSTRACT: Implement current as a closure stored in the registry
4              
5 39     39   344448 use v5.28;
  39         159  
6 39     39   240 use strict;
  39         83  
  39         1132  
7 39     39   184 use warnings;
  39         74  
  39         2962  
8              
9             our $VERSION = '0.33';
10              
11 39     39   761 use Iterator::Flex::Utils qw( :default REG_ITERATOR REG_ITER_CURRENT );
  39         80  
  39         5558  
12 39     39   1022 use Role::Tiny;
  39         7256  
  39         334  
13 39     39   11428 use experimental 'signatures';
  39         89  
  39         313  
14              
15 39     39   7356 use namespace::clean;
  39         19553  
  39         334  
16              
17              
18              
19              
20              
21              
22              
23              
24              
25              
26              
27 378     378 1 31067 sub current ( $self ) {
  378         578  
  378         570  
28 378         1256 $REGISTRY{ refaddr $self }[REG_ITERATOR][REG_ITER_CURRENT]->( $self );
29             }
30             *__current__ = \¤t;
31              
32             1;
33              
34             #
35             # This file is part of Iterator-Flex
36             #
37             # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
38             #
39             # This is free software, licensed under:
40             #
41             # The GNU General Public License, Version 3, June 2007
42             #
43              
44             __END__