tweak action methods in Result
Matt S Trout [Tue, 11 Feb 2014 07:23:04 +0000 (07:23 +0000)]
lib/DX/Result.pm

index 008ea73..2e49cf7 100644 (file)
@@ -14,7 +14,12 @@ sub actions {
   return map $_->action, grep $_->has_action, values %$by_id;
 }
 
-sub dependent_actions {
+sub independent_actions {
+  my ($self) = @_;
+  return grep !@{$_->dependencies}, $self->actions;
+}
+
+sub expand_action_dependencies {
   my ($self, $action) = @_;
   my $by_id = $self->_state->by_id;
   return map $by_id->{$_}->action, @{$action->dependencies};