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
diff --git a/t/lib/Data/Perl/Stream/Array.pm b/t/lib/Data/Perl/Stream/Array.pm
new file mode 100644 (file)
index 0000000..cb0ccf5
--- /dev/null
@@ -0,0 +1,22 @@
+package Data::Perl::Stream::Array;
+
+use Moose;
+use Method::Signatures::Simple;
+
+has _array => (is => 'rw', required => 1, init_arg => 'array');
+
+method BUILD { $self->_array([ @{$self->_array} ]) }
+
+method next {
+  my $ary = $self->_array;
+  return unless @$ary;
+  return shift @$ary;
+}
+
+method map ($map_func) {
+  ref($self)->new(array => [ map { $map_func->($_) } @{$self->_array} ]);
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;