| 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
| |||||||||||||||||||||
| 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)
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)
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 66 | 945 | return $self->fq_name; | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | 12 | 1; | |||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | __END__ | ||||||||||||||||||||