1 package DX::ActionBuilder::Null;
5 with 'DX::Role::ActionBuilder';
7 has target_path => (is => 'ro');
9 around target_path => sub {
10 my ($orig, $self) = (shift, shift);
11 return undef unless ref($self);
12 return $self->$orig(@_);
15 sub can_set_value { 0 }
17 sub action_for_set_value { undef }
19 sub action_for_add_member { undef }
21 sub action_for_set_member { undef }
23 sub action_for_remove_member { undef }
25 sub specialize_for_member {
27 return $self unless ref($self);
28 return $self unless my $path = $self->target_path;
30 target_path => [ @{$self->target_path}, $at ]
35 my ($self, $value) = @_;
36 my $new_value = $value->but_set_action_builder($self)
37 ->but_set_identity_path($self->target_path);
38 return $new_value unless $new_value->isa('DX::Value::Dict');
39 my %m = %{$new_value->members};
40 return $new_value->but(
42 map +($_ => $self->specialize_for_member($_)->apply_to_value($m{$_})),