e1e8bf829c2e68efdfee6f93f24fded773fd3cff
[scpubgit/DX.git] / lib / DX / ActionBuilder / ProxySetToAdd.pm
1 package DX::ActionBuilder::ProxySetToAdd;
2
3 use DX::Utils qw(VALUE_SET);
4 use DX::Class;
5
6 with 'DX::Role::ActionBuilder';
7
8 has target_path => (is => 'ro', required => 1);
9
10 has proxy_to => (is => 'ro', required => 1);
11
12 sub aperture_for_set_value {
13   my ($self) = @_;
14   [
15     [ VALUE_SET ,=> @{$self->target_path} ],
16     @{$self->proxy_to->aperture_for_add_member($self->target_path->[-1])}
17   ]
18 }
19
20 sub action_for_set_value {
21   my ($self, $value) = @_;
22   $self->proxy_to->action_for_add_member($self->target_path->[-1], $value);
23 }
24
25 1;