aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Field/Collection.pm
blob: 02dfa7540f0a22d0281af97c8cff6eaf237b10db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package Reaction::UI::ViewPort::Field::Collection;

use Reaction::Class;
use Scalar::Util 'blessed';
use aliased 'Reaction::UI::ViewPort::Field::Array';

use namespace::clean -except => [ qw(meta) ];
extends Array;



has value => (
  is => 'rw', lazy_build => 1,
  isa => 'Reaction::InterfaceModel::Collection'
);
sub _build_value_names {
  my $self = shift;
  my $meth = $self->value_map_method;
  my @names = map { blessed($_) ? $_->$meth : $_ } $self->value->members;
  return [ sort @names ];
};

__PACKAGE__->meta->make_immutable;


1;