File Coverage

blib/lib/Data/Stream/Bulk/Nil.pm
Criterion Covered Total %
statement 2 4 50.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 4 6 66.6


line stmt bran cond sub pod time code
1             package Data::Stream::Bulk::Nil;
2             BEGIN {
3 1     1   24196 $Data::Stream::Bulk::Nil::AUTHORITY = 'cpan:NUFFIN';
4             }
5             {
6             $Data::Stream::Bulk::Nil::VERSION = '0.11';
7             }
8 1     1   1712 use Moose;
  0            
  0            
9             # ABSTRACT: An empty L<Data::Stream::Bulk> iterator
10              
11             use namespace::clean -except => 'meta';
12              
13             with qw(Data::Stream::Bulk) => { -excludes => [qw/loaded filter list_cat all items/] };
14              
15             sub items { return () }
16              
17             sub all { return () }
18              
19             sub next { undef }
20              
21             sub is_done { 1 }
22              
23             sub list_cat {
24             my ( $self, $head, @rest ) = @_;
25              
26             return () unless $head;
27             return $head->list_cat(@rest);
28             }
29              
30             sub filter { return $_[0] };
31              
32             sub loaded { 1 }
33              
34             __PACKAGE__->meta->make_immutable;
35              
36             __PACKAGE__;
37              
38              
39              
40             =pod
41              
42             =head1 NAME
43              
44             Data::Stream::Bulk::Nil - An empty L<Data::Stream::Bulk> iterator
45              
46             =head1 VERSION
47              
48             version 0.11
49              
50             =head1 SYNOPSIS
51              
52             return Data::Stream::Bulk::Nil->new; # empty set
53              
54             =head1 DESCRIPTION
55              
56             This iterator can be used to return the empty resultset.
57              
58             =head1 METHODS
59              
60             =over 4
61              
62             =item is_done
63              
64             Always returns true.
65              
66             =item next
67              
68             Always returns undef.
69              
70             =item items
71              
72             =item all
73              
74             Always returns the empty list.
75              
76             =item list_cat
77              
78             Skips $self
79              
80             =item filter
81              
82             Returns $self
83              
84             =item loaded
85              
86             Returns true.
87              
88             =back
89              
90             =head1 AUTHOR
91              
92             Yuval Kogman <nothingmuch@woobling.org>
93              
94             =head1 COPYRIGHT AND LICENSE
95              
96             This software is copyright (c) 2012 by Yuval Kogman.
97              
98             This is free software; you can redistribute it and/or modify it under
99             the same terms as the Perl 5 programming language system itself.
100              
101             =cut
102              
103              
104             __END__
105