fix matching passwords stuff
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / Mutable / Array.pm
1 package Reaction::UI::ViewPort::Field::Mutable::Array;
2
3 use Reaction::Class;
4
5 use namespace::clean -except => [ qw(meta) ];
6 extends 'Reaction::UI::ViewPort::Field::Array';
7
8 with 'Reaction::UI::ViewPort::Field::Role::Mutable';
9
10 around value => sub {
11   my $orig = shift;
12   my $self = shift;
13   return $orig->($self) unless @_;
14   my $value = defined $_[0] ? $_[0] : [];
15   $orig->($self, (ref $value eq 'ARRAY' ? $value : [ $value ]));
16 };
17 __PACKAGE__->meta->make_immutable;
18
19
20 1;
21