File Coverage

blib/lib/Data/TableReader/Iterator.pm
Criterion Covered Total %
statement 23 27 85.1
branch 1 2 50.0
condition 1 3 33.3
subroutine 10 14 71.4
pod 7 7 100.0
total 42 53 79.2


line stmt bran cond sub pod time code
1             package Data::TableReader::Iterator;
2 11     11   81 use strict;
  11         27  
  11         548  
3 11     11   67 use warnings;
  11         30  
  11         572  
4 11     11   58 use Try::Tiny;
  11         21  
  11         933  
5 11     11   86 use Carp;
  11         19  
  11         949  
6 11     11   71 use Scalar::Util 'refaddr';
  11         19  
  11         3889  
7              
8             # ABSTRACT: Base class for iterators (blessed coderefs)
9             our $VERSION = '0.021'; # VERSION
10              
11              
12             our %_iterator_fields;
13             sub new {
14 70     70 1 187 my ($class, $sub, $fields)= @_;
15 70 50 33     443 ref $sub eq 'CODE' and ref $fields eq 'HASH'
16             or croak "Expected new(CODEREF, HASHREF)";
17 70         257 $_iterator_fields{refaddr $sub}= $fields;
18 70         467 return bless $sub, $class;
19             }
20              
21             sub _fields {
22 160     160   713 $_iterator_fields{refaddr shift};
23             }
24              
25             sub DESTROY {
26 70     70   34322 delete $_iterator_fields{refaddr shift};
27             }
28              
29             sub progress {
30 0     0 1 0 undef;
31             }
32              
33             sub row {
34 0     0 1 0 croak "Unimplemented";
35             }
36              
37             sub dataset_idx {
38 7     7 1 65 0
39             }
40              
41             sub tell {
42 0     0 1 0 undef;
43             }
44              
45             sub seek {
46 0     0 1 0 croak "Unimplemented";
47             }
48              
49             sub next_dataset {
50 11     11 1 54 undef;
51             }
52              
53             1;
54              
55             __END__