dependency map up, some code running
[scpubgit/DX.git] / lib / DX / Action / SetValue.pm
CommitLineData
efad53c4 1package DX::Action::SetValue;
2
3use DX::Update::SetValue;
4use DX::Class;
5
6has target_path => (is => 'ro', required => 1);
7
8has new_value => (is => 'ro', required => 1);
9
10has _update => (is => 'lazy');
11
12sub dry_run {
13 my ($self, $hyp) = @_;
14 my ($scope, @events) = $self->_update->apply_to($hyp->scope);
15 return (
16 $hyp->but(
17 actions => [ @{$hyp->actions}, $self ],
18 scope => $scope
19 ),
20 @events,
21 );
22}
23
24sub _build__update {
25 my ($self) = @_;
26 DX::Update::SetValue->new(
27 target_path => $self->target_path,
28 new_value => $self->new_value,
29 );
30}
31
321;