| 1 | package Reaction::UI::ViewPort::Field::Array; | ||||||||||
| 2 | |||||||||||
| 3 | 5 | ▶ | use Reaction::Class; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | use Scalar::Util 'blessed'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 5 | extends 'Reaction::UI::ViewPort::Field'; | |||||||||
| 7 | |||||||||||
| 8 | 5 | ▶ | use namespace::clean -except => [ qw(meta) ]; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 5 | ▶ | use MooseX::Types::Moose qw/Str ArrayRef/;; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 5 | has '+value' => (isa => ArrayRef); | |||||||||
| 13 | |||||||||||
| 14 | 5 | has value_names => (isa => ArrayRef, is => 'ro', lazy_build => 1); | |||||||||
| 15 | has value_map_method => ( | ||||||||||
| 16 | 0 | ▶ | isa => Str, is => 'ro', required => 1, default => sub { 'display_name' }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 17 | 5 | ); | |||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub _build_value_names { | ||||||||
|
Subroutine
_build_value_names: not called CC=2 SCAR=17.9
| |||||||||||
| 20 | 0 | my $self = shift; | |||||||||
| 21 | 0 | my $meth = $self->value_map_method; | |||||||||
| 22 | 0 | ▶ | my @names = map { blessed($_) ? $_->$meth : $_ } @{ $self->value }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | return [ sort @names ]; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | sub _empty_value { [] } | ||||||||
|
Subroutine
_empty_value: not called CC=1 SCAR=6.9
| |||||||||||
| 27 | |||||||||||
| 28 | 5 | __PACKAGE__->meta->make_immutable; | |||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | 5 | 1; | |||||||||