blib/lib/Rose/HTML/Form/Field/Option.pm

filter: Statementstmt 100% 36 / 36 Branchbran 100% 4 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 13 / 13 Podpod 77.7% 7 / 9 totaltotal 92.5% 62 / 67 CC 4 SCAR 3.2
CC
4
Cov
98%
label_text_object
2.0
label
2.0
name
2.0
CRAP 1.4
« blib/lib/Rose/HTML/Anchor.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/SelectBox.pm »
1 package Rose::HTML::Form::Field::Option;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 12 ▶use Rose::HTML::Util();
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Rose::HTML::Text;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 ▶use base qw(Rose::HTML::Object::WithWrapAroundChildren
Subroutine BEGIN: called CC=1 SCAR=0.0
9 12 Rose::HTML::Form::Field::OnOff::Selectable);
10  
11 12 our $VERSION = '0.606';
12  
13 12 __PACKAGE__->add_valid_html_attrs
14 (
15 'label',
16 'selected',
17 );
18  
19 12 __PACKAGE__->add_boolean_html_attrs
20 (
21 'selected',
22 );
23  
24 12 __PACKAGE__->delete_valid_html_attrs(qw(name type checked));
25 12 __PACKAGE__->delete_required_html_attr('type');
26  
27 1484 ▶sub html_element { 'option' }
Subroutine html_element: called CC=1 SCAR=0.0
Pod documented
28 292 ▶sub xhtml_element { 'option' }
Subroutine xhtml_element: called CC=1 SCAR=0.0
Pod documented
29  
30 sub html_field
31 445 ▶{
Subroutine html_field: called CC=1 SCAR=0.0
Pod documented
32 445 my($self) = shift;
33 445 $self->html_attr(selected => $self->selected);
34 445 return $self->html_tag(@_);
35 }
36  
37 sub xhtml_field
38 145 ▶{
Subroutine xhtml_field: called CC=1 SCAR=0.0
Pod documented
39 145 my($self) = shift;
40 145 $self->html_attr(selected => $self->selected);
41 145 return $self->xhtml_tag(@_);
42 }
43  
44 1184 ▶sub immutable_children { shift->label_text_object }
Subroutine immutable_children: called CC=1 SCAR=0.0
Pod undocumented
45  
46 sub label
47 393 ▶{
Subroutine label: called CC=2 SCAR=6.9
Pod documented
48 393 my($self) = shift;
49 393 ▶ $self->label_text_object->text(@_) if(@_);
Branch: 1 branch
BranchTrueFalseTotal
if @_ 214 179 393
50 393 return $self->SUPER::label(@_);
51 }
52  
53 sub label_text_object
54 1398 ▶{
Subroutine label_text_object: called CC=2 SCAR=7.1
Pod undocumented
55 1398 my($self) = shift;
56 1398 ▶ return $self->{'label_text_object'} ||=
Condition66%2/3
$self->{"label_text_object"} ||= ref($self)->object_type_class_loaded("literal text")->new("text", $self->label)
l!l&&r!l&&!r
12391590
MC/DC0%0/2
$self->{"label_text_object"} ||= ref($self)->object_type_class_loaded("literal text")->new("text", $self->label)
$self->{"label_text_object"} ref($self)->object_type_class_loaded("literal text")->new("text", $self->label)
Truth table66%2/3
A ||= B
A= $self->{"label_text_object"}B= ref($self)->object_type_class_loaded("literal text")->new("text", $self->label)
ABresult
1X1
011
000
57 ref($self)->object_type_class_loaded('literal text')->new(text => $self->label);
58 }
59  
60 7 ▶sub short_label { shift->html_attr('label', @_) }
Subroutine short_label: called CC=1 SCAR=0.0
Pod documented
61  
62 sub name
63 945 ▶{
Subroutine name: called CC=2 SCAR=6.9
Pod documented
64 945 my($self) = shift;
65 945 ▶ $self->local_name(shift) if(@_);
Branch: 1 branch
BranchTrueFalseTotal
if @_ 744 201 945
66 945 return $self->fq_name;
67 }
68  
69 12 1;
70  
71 __END__
« blib/lib/Rose/HTML/Anchor.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/SelectBox.pm »