implement ->equals for values
[scpubgit/DX.git] / lib / DX / Role / SimpleAction.pm
CommitLineData
9d759b64 1package DX::Role::SimpleAction;
2
3use DX::Role;
4
0498469a 5has target_path => (is => 'ro', required => 1);
9d759b64 6
0498469a 7has _updates => (is => 'lazy');
9d759b64 8
0498469a 9requires '_build__updates';
10
11sub 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
23sub run { shift->updates }
24
251;