rename is_dict to dict, add proto argument
[scpubgit/DX.git] / lib / DX / ActionBuilder / BoundValue.pm
CommitLineData
1e90aa03 1package DX::ActionBuilder::BoundValue;
2
3use DX::Action::SetBoundValue;
4#use DX::Action::AddBoundValue;
5use DX::Class;
6
7with 'DX::Role::ActionBuilder';
8
9has target_path => (is => 'ro', required => 1);
10
11has rebind_path => (is => 'ro', required => 1);
12
13has bound_to_path => (is => 'ro', required => 1);
14
15has inner_action_builder => (is => 'ro', required => 1);
16
17sub action_for_set_value {
18 my ($self, $value) = @_;
19 my $inner_action = $self->inner_action_builder->action_for_set_value($value);
20 return undef unless $inner_action;
21 DX::Action::SetBoundValue->new(
22 target_path => $self->target_path,
23 rebind_path => $self->rebind_path,
24 new_value => $value->but_set_action_builder($self)
25 ->but_set_identity_path($self->bound_to_path),
26 inner_action => $inner_action,
27 )
28}
29
301;