| 1 | package TAPx::Harness::Compatible::Iterator; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use TAPx::Parser::Iterator; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | $VERSION = '0.50_07'; | |||||||||
| 8 | |||||||||||
| 9 | =head1 NAME | ||||||||||
| 10 | |||||||||||
| 11 | TAPx::Harness::Compatible::Iterator - Internal TAPx::Harness::Compatible Iterator | ||||||||||
| 12 | |||||||||||
| 13 | =head1 SYNOPSIS | ||||||||||
| 14 | |||||||||||
| 15 | use TAPx::Harness::Compatible::Iterator; | ||||||||||
| 16 | my $it = TAPx::Harness::Compatible::Iterator->new(\*TEST); | ||||||||||
| 17 | my $it = TAPx::Harness::Compatible::Iterator->new(\@array); | ||||||||||
| 18 | |||||||||||
| 19 | my $line = $it->next; | ||||||||||
| 20 | |||||||||||
| 21 | =head1 DESCRIPTION | ||||||||||
| 22 | |||||||||||
| 23 | B<FOR INTERNAL USE ONLY!> | ||||||||||
| 24 | |||||||||||
| 25 | This is a simple iterator wrapper for arrays and filehandles. | ||||||||||
| 26 | |||||||||||
| 27 | =head2 new() | ||||||||||
| 28 | |||||||||||
| 29 | Create an iterator. | ||||||||||
| 30 | |||||||||||
| 31 | =head2 next() | ||||||||||
| 32 | |||||||||||
| 33 | Iterate through it, of course. | ||||||||||
| 34 | |||||||||||
| 35 | =cut | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 38 | 0 | my ( $class, $thing ) = @_; | |||||||||
| 39 | |||||||||||
| 40 | 0 | return bless { iter => TAPx::Parser::Iterator->new($thing) }, $class; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 0 | ▶ | sub next { | ||||||||
|
Subroutine
next: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 44 | 0 | my $next = shift->{iter}->next_raw; | |||||||||
| 45 | 0 | ▶ | return defined $next ? "$next\n" : $next; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 1 | 1; | |||||||||