From: Matt S Trout Date: Tue, 11 Feb 2014 07:23:04 +0000 (+0000) Subject: tweak action methods in Result X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FDKit.git;a=commitdiff_plain;h=60c182d8c6c3ee2ea17e7938908c15a4f95e2a90 tweak action methods in Result --- diff --git a/lib/DX/Result.pm b/lib/DX/Result.pm index 008ea73..2e49cf7 100644 --- a/lib/DX/Result.pm +++ b/lib/DX/Result.pm @@ -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};