pervasive type constraints
[scpubgit/DX.git] / lib / DX / Update / SetValue.pm
index ff1e991..ae252c8 100644 (file)
@@ -1,10 +1,11 @@
 package DX::Update::SetValue;
 
+use DX::Utils qw(VALUE_SET);
 use DX::Class;
 
 with 'DX::Role::Update';
 
-has new_value => (is => 'ro', required => 1);
+has new_value => (is => 'ro', required => 1, isa => Value);
 
 sub apply_to {
   my ($self, $scope) = @_;
@@ -12,7 +13,7 @@ sub apply_to {
   my $new_value = $self->new_value;
   return (
     $self->_with_value_at_path($scope, sub { $new_value }, @path),
-    \@path
+    [ VALUE_SET ,=> @path ],
   );
 }