Factory/Control/Role/Labeled.pm

filter: Statementstmt 100% 11 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 13 / 13 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
_build_label
1.0
CRAP 1.0
« Factory/Control/Role/HiddenValue.pm ↑ Summary Factory/Control/Role/ListValue.pm »
1 package Form::Factory::Control::Role::Labeled;
2 1 $Form::Factory::Control::Role::Labeled::VERSION = '0.022';
3 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: labeled controls
6  
7  
8 1 has label => (
9 is => 'ro',
10 isa => 'Str',
11 required => 1,
12 builder => '_build_label',
13 lazy => 1,
14 );
15  
16 31 ▶sub _build_label {
Subroutine _build_label: called CC=1 SCAR=0.0
17 31 my $self = shift;
18 31 my $label = $self->name;
19 31 $label =~ s/_/ /g;
20 31 $label =~ s/\b(\w)/\U$1\E/g;
21 31 return $label;
22 }
23  
24 1 1;
25  
26 __END__
« Factory/Control/Role/HiddenValue.pm ↑ Summary Factory/Control/Role/ListValue.pm »