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
CommitLineData
6b6ce2e0 1package Data::Perl::Stream::Array;
2
3use Moose;
4use Method::Signatures::Simple;
5
6has _array => (is => 'rw', required => 1, init_arg => 'array');
7
8method BUILD { $self->_array([ @{$self->_array} ]) }
9
10method next {
11 my $ary = $self->_array;
12 return unless @$ary;
13 return shift @$ary;
14}
15
16method map ($map_func) {
17 ref($self)->new(array => [ map { $map_func->($_) } @{$self->_array} ]);
18}
19
20__PACKAGE__->meta->make_immutable;
21
221;