package DX::RefSet;

use DX::FactRef;
use DX::ArrayStream;
use Moo;

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

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

sub to_stream {
  my ($self) = @_;
  return DX::ArrayStream->from_array(
    map DX::FactRef->new(fact_type => $self->target, fact_id => $_),
      @{$self->names}
  );
}

1;
