blib/lib/ObjectDB/Iterator.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 6 | 14 | 42.8 |
branch | n/a | ||
condition | n/a | ||
subroutine | 2 | 4 | 50.0 |
pod | 0 | 2 | 0.0 |
total | 8 | 20 | 40.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package ObjectDB::Iterator; | ||||||
2 | |||||||
3 | 5 | 5 | 33 | use strict; | |||
5 | 10 | ||||||
5 | 137 | ||||||
4 | 5 | 5 | 27 | use warnings; | |||
5 | 43 | ||||||
5 | 571 | ||||||
5 | |||||||
6 | sub new { | ||||||
7 | 0 | 0 | 0 | my $class = shift; | |||
8 | 0 | my (%params) = @_; | |||||
9 | |||||||
10 | 0 | my $self = {}; | |||||
11 | 0 | bless $self, $class; | |||||
12 | |||||||
13 | 0 | $self->{walker} = $params{walker}; | |||||
14 | |||||||
15 | 0 | return $self; | |||||
16 | } | ||||||
17 | |||||||
18 | sub next { | ||||||
19 | 0 | 0 | 0 | my $self = shift; | |||
20 | |||||||
21 | 0 | return $self->{walker}->($self); | |||||
22 | } | ||||||
23 | |||||||
24 | 1; |