Commit | Line | Data |
---|---|---|
9d759b64 | 1 | package DX::Role::SimpleAction; |
2 | ||
3 | use DX::Role; | |
4 | ||
0498469a | 5 | has target_path => (is => 'ro', required => 1); |
9d759b64 | 6 | |
0498469a | 7 | has _updates => (is => 'lazy'); |
9d759b64 | 8 | |
0498469a | 9 | requires '_build__updates'; |
10 | ||
11 | sub dry_run { | |
9d759b64 | 12 | my ($self, $hyp) = @_; |
0498469a | 13 | my ($scope, @events) = $hyp->scope->apply_updates($self->_updates); |
9d759b64 | 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; |