package DX::ArrayStream;

use Moo;

has array => (is => 'ro', required => 1);

sub from_array {
  my ($class, @array) = @_;
  $class->new(array => \@array);
}

sub next {
  shift @{$_[0]->array};
}

sub is_exhausted { !@{$_[0]->array} }

1;
