initial partial sketch
[scpubgit/DX.git] / lib / DX / Update / SetValue.pm
1 package DX::Update::SetValue;
2
3 use DX::Class;
4
5 with 'DX::Role::Update';
6
7 has new_value => (is => 'ro', required => 1);
8
9 sub apply_to {
10   my ($self, $scope) = @_;
11   my @path = @{$self->target_path};
12   my $new_value = $self->new_value;
13   return (
14     $self->_with_value_at_path($scope, sub { $new_value }, @path),
15     \@path
16   );
17 }
18
19 1;