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   187876 use v5.28;
  39         117  
6 39     39   148 use strict;
  39         60  
  39         787  
7 39     39   122 use warnings;
  39         55  
  39         2377  
8              
9             our $VERSION = '0.34';
10              
11 39     39   585 use Iterator::Flex::Utils qw( :default REG_ITERATOR REG_ITER_CURRENT );
  39         55  
  39         4335  
12 39     39   624 use Role::Tiny;
  39         4560  
  39         227  
13 39     39   7947 use experimental 'signatures';
  39         81  
  39         269  
14              
15 39     39   4754 use namespace::clean;
  39         11303  
  39         205  
16              
17              
18              
19              
20              
21              
22              
23              
24              
25              
26              
27 378     378 1 15662 sub current ( $self ) {
  378         425  
  378         396  
28 378         765 $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__