dd76714d558d9c059e1defeca8e397d63a2e8bc9
[scpubgit/DX.git] / lib / DX / Role / SimpleAction.pm
1 package DX::Role::SimpleAction;
2
3 use DX::Role;
4
5 has updates => (is => 'lazy');
6
7 requires '_build_updates';
8
9 sub dry_run_against {
10   my ($self, $hyp) = @_;
11   my ($scope, @events) = $hyp->scope->apply_updates($self->updates);
12   return (
13     $hyp->but(
14       scope => $scope,
15       actions => [ @{$hyp->actions}, $self ],
16     ),
17     @events
18   );
19 }
20
21 sub run { shift->updates }
22
23 1;