remove the _then bind methods
[scpubgit/DKit.git] / lib / DX / Op / MemberOf.pm
CommitLineData
b40e416a 1package DX::Op::MemberOf;
2
3use DX::ArrayStream;
4use Moo;
5
6with 'DX::Role::Op';
7
8has member_var => (is => 'ro', required => 1);
385fa954 9has coll_var => (is => 'ro', required => 1);
b40e416a 10
11sub run {
12 my ($self, $state) = @_;
385fa954 13 ($state, my %args) = $self->_expand_args($state,
14 member => $self->member_var,
15 of => $self->coll_var
16 );
17 my ($member, $of) = @args{qw(member of)};
b40e416a 18 die "member bound" if $member->is_bound;
385fa954 19 my $set = $state->facts->{$of->bound_value};
7a0670cd 20 return $state->then($self->next)
21 ->add_dependencies($member->id, $of->id)
22 ->bind_root_set($member->id, $set)
b40e416a 23}
24
251;