1 package DX::ActionBuilder::UnsetValue;
3 use DX::Action::SetValue;
4 use DX::ActionBuilder::Normal;
5 use DX::Action::BindValue;
6 use DX::ActionBuilder::BoundValue;
9 with 'DX::Role::ActionBuilder';
11 has target_path => (is => 'ro', required => 1);
13 sub action_for_set_value {
14 my ($self, $value) = @_;
15 if (my $p = $value->identity_path) {
16 my $ab = DX::ActionBuilder::BoundValue->new(
17 target_path => $self->target_path,
18 rebind_path => $self->target_path,
20 inner_action_builder => $value->action_builder,
22 return DX::Action::BindValue->new(
23 target_path => $self->target_path,
24 new_value => $value->but_set_action_builder($ab),
27 my $ab = DX::ActionBuilder::Normal->new(
28 target_path => $self->target_path,
30 DX::Action::SetValue->new(
31 target_path => $self->target_path,
32 new_value => $value->but_set_action_builder($ab)
33 ->but_set_identity_path($self->target_path),