Add in Data::Perl::Collection::Set from DBIx-Data-Store-old so we can run tests.
[catagits/App-IdiotBox.git] / t / lib / Data / Perl / Stream / Array.pm
1 package Data::Perl::Stream::Array;
2
3 use Moose;
4 use Method::Signatures::Simple;
5
6 has _array => (is => 'rw', required => 1, init_arg => 'array');
7
8 method BUILD { $self->_array([ @{$self->_array} ]) }
9
10 method next {
11   my $ary = $self->_array;
12   return unless @$ary;
13   return shift @$ary;
14 }
15
16 method map ($map_func) {
17   ref($self)->new(array => [ map { $map_func->($_) } @{$self->_array} ]);
18 }
19
20 __PACKAGE__->meta->make_immutable;
21
22 1;