rewrite deparse system
[scpubgit/DX.git] / lib / DX / Role / SimpleAction.pm
index f0b3120..62bf837 100644 (file)
@@ -10,6 +10,15 @@ has _updates => (is => 'lazy');
 
 requires '_build__updates';
 
+sub for_deparse {
+  my ($self) = @_;
+  [ statement => [
+    [ symbol => (split('::',ref($self)))[-1] ],
+    [ value_path => $self->target_path ],
+    $self->new_value,
+  ] ];
+}
+
 sub dry_run {
   my ($self, $hyp) = @_;
   my ($scope, @events) = $hyp->scope->apply_updates($self->_updates);
@@ -17,6 +26,7 @@ sub dry_run {
     $hyp->but(
       scope => $scope,
       actions => [ @{$hyp->actions}, $self ],
+      action_applications => [ @{$hyp->action_applications}, $self ],
     ),
     @events
   );