eliminate variable name requirement from query()
[scpubgit/DKit.git] / lib / DX / Op / Exists.pm
CommitLineData
deec7cc4 1package DX::Op::Exists;
2
3use DX::Op::SetScope;
4use Moo;
5
6has vars => (is => 'ro', required => 1);
7has body => (is => 'ro', required => 1);
8
9with 'DX::Role::Op';
10
11sub run {
12 my ($self, $state) = @_;
13 my $ret_op = DX::Op::SetScope->new(
14 scope => $state->scope,
15 next => $self->next
16 );
17 $state->assign_vars(map +($_ => {}), @{$self->vars})
18 ->push_return_then($ret_op, $self->body);
19}
20
211;