line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
36
|
|
|
36
|
|
105332
|
use Moo::Role; |
|
36
|
|
|
|
|
149
|
|
|
36
|
|
|
|
|
219
|
|
4
|
36
|
|
|
36
|
|
236
|
|
|
36
|
|
|
|
|
74
|
|
|
36
|
|
|
|
|
195
|
|
5
|
|
|
|
|
|
|
has exhausted => (is => 'rwp', default => sub {0}); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
around generator => sub { |
8
|
|
|
|
|
|
|
my ($orig, $self) = @_; |
9
|
|
|
|
|
|
|
return sub { } |
10
|
|
|
|
|
|
|
if $self->exhausted; |
11
|
|
|
|
|
|
|
$self->_set_exhausted(1); |
12
|
|
|
|
|
|
|
$orig->($self); |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
0
|
0
|
|
1; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=pod |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Catmandu::IterableOnce - Role for iterable classes that can only iterate once |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
package MySingleUseIterator; |
28
|
|
|
|
|
|
|
use Moo; |
29
|
|
|
|
|
|
|
with 'Catmandu::Iterable'; |
30
|
|
|
|
|
|
|
with 'Catmandu::Iterableonce'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub generator { |
33
|
|
|
|
|
|
|
# ... |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SEE ALSO |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
L<Catmandu::Iterable>. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |