package DX::Action::FromCode;

use Moo;

has expect => (is => 'ro', required => 1);

has perform => (is => 'ro', required => 1);

has dependencies => (is => 'ro', default => sub { [] });

sub expected_effect { $_[0]->expect->() }
sub run { $_[0]->perform->() }

sub but { my ($self, @but) = @_; ref($self)->new(%$self, @but); }

1;
