pervasive type constraints
[scpubgit/DX.git] / lib / DX / Action / BindValue.pm
CommitLineData
1e90aa03 1package DX::Action::BindValue;
2
3use DX::Update::SetValue;
4use DX::ActionBuilder::BoundValue;
5use DX::Class;
6
7with 'DX::Role::SimpleAction';
8
2548ce61 9has new_value => (is => 'ro', required => 1, isa => Value);
1e90aa03 10
c25fbf05 11sub for_deparse {
12 my ($self) = @_;
13 [ statement => [
14 [ symbol => 'BindValue' ],
15 [ value_path => $self->target_path ],
16 [ value_path => $self->new_value
17 ->action_builder
18 ->inner_action_builder
19 ->target_path ],
20 ] ];
21}
22
1e90aa03 23sub _build__updates {
24 my ($self) = @_;
2548ce61 25 [
26 DX::Update::SetValue->new(
27 target_path => $self->target_path,
28 new_value => $self->new_value,
29 )
30 ]
1e90aa03 31}
32
331;
34