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