factor out FindIsh, implement ForEach
[scpubgit/DKit.git] / lib / DX / Op / ForEach.pm
1 package DX::Op::ForEach;
2
3 use DX::Op::OneEach;
4 use Moo;
5
6 with 'DX::Role::Op::FindIsh';
7
8 has each_body => (is => 'ro', required => 1);
9
10 sub make_result_handler {
11   my ($self, $coll) = @_;
12   DX::Op::OneEach->new(
13     var_name => $self->var_name,
14     each_of => $coll->values,
15     each_body => $self->each_body,
16     next => $self->next
17   );
18 }
19
20 1;