blib/lib/HTML/Zoom/ArrayStream.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 12 | 12 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 18 | 19 | 94.7 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package HTML::Zoom::ArrayStream; | ||||||
2 | |||||||
3 | 13 | 13 | 60 | use strictures 1; | |||
13 | 62 | ||||||
13 | 265 | ||||||
4 | 13 | 13 | 779 | use base qw(HTML::Zoom::StreamBase); | |||
13 | 21 | ||||||
13 | 2008 | ||||||
5 | |||||||
6 | sub new { | ||||||
7 | 406 | 406 | 0 | 409 | my ($class, $args) = @_; | ||
8 | 406 | 2035 | bless( | ||||
9 | 406 | 467 | { _zconfig => $args->{zconfig}, _array => [ @{$args->{array}} ] }, | ||||
10 | $class | ||||||
11 | ); | ||||||
12 | } | ||||||
13 | |||||||
14 | sub _next { | ||||||
15 | 2193 | 2193 | 2238 | my $ary = $_[0]->{_array}; | |||
16 | 2193 | 100 | 3549 | return unless @$ary; | |||
17 | 1791 | 4867 | return shift @$ary; | ||||
18 | } | ||||||
19 | |||||||
20 | 1; |