| 1 | package XML::Elemental::Element; | ||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 3 | ▶ | use base qw( XML::Elemental::Node ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 17 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 6 | 17 | my $self = bless {}, $_[0]; | |||||||||||
| 7 | 17 | $self->{attribute} = {}; | |||||||||||
| 8 | 17 | $self->{contents} = []; | |||||||||||
| 9 | 17 | return $self; | |||||||||||
| 10 | } | ||||||||||||
| 11 | |||||||||||||
| 12 | 3 | ▶ | sub text_content { | ||||||||||
|
Subroutine
text_content: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||
| 13 | 3 | ▶ | return '' unless defined $_[0]->{contents}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | return join('', | ||||||||||||
| 15 | 5 | ▶ | map { $_->can('text_content') ? $_->text_content : $_->data } | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 16 | 3 | @{$_[0]->contents}); | |||||||||||
| 17 | } | ||||||||||||
| 18 | |||||||||||||
| 19 | 11 | ▶ | sub name { | ||||||||||
|
Subroutine
name: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||
| 20 | 11 | ▶ | $_[0]->{name} = $_[1] if @_ > 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 11 | return $_[0]->{name}; | |||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | 3 | ▶ | sub parent { | ||||||||||
|
Subroutine
parent: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||
| 25 | 3 | ▶ | $_[0]->{parent} = $_[1] if @_ > 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 3 | return $_[0]->{parent}; | |||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 8 | ▶ | sub contents { | ||||||||||
|
Subroutine
contents: called CC=3 SCAR=11.7
Pod
documented
| |||||||||||||
| 30 | 8 | ▶ | $_[0]->{contents} ||= []; | ||||||||||
|
Condition50%1/2
$_[0]{"contents"} ||= []
MC/DC0%0/1
$_[0]{"contents"} ||= []
$_[0]{"contents"}
Truth table50%1/2
A
A= $_[0]{"contents"}
| |||||||||||||
| 31 | 8 | ▶ | $_[0]->{contents} = $_[1] if @_ > 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | 8 | return $_[0]->{contents}; | |||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 2 | ▶ | sub attributes { | ||||||||||
|
Subroutine
attributes: called CC=3 SCAR=11.7
Pod
documented
| |||||||||||||
| 36 | 2 | ▶ | $_[0]->{attributes} ||= {}; | ||||||||||
|
Condition50%1/2
$_[0]{"attributes"} ||= {}
MC/DC0%0/1
$_[0]{"attributes"} ||= {}
$_[0]{"attributes"}
Truth table50%1/2
A
A= $_[0]{"attributes"}
| |||||||||||||
| 37 | 2 | ▶ | $_[0]->{attributes} = $_[1] if @_ > 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | 2 | return $_[0]->{attributes}; | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 3 | 1; | |||||||||||
| 42 | |||||||||||||
| 43 | __END__ | ||||||||||||