| 1 | package DTL::Fast::Text; | ||||||||||||
| 2 | 98 | ▶ | use strict; use utf8; use warnings FATAL => 'all'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | |||||||||||||
| 4 | 98 | ▶ | use DTL::Fast::Template; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 98 | ▶ | use Scalar::Util qw/weaken/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | sub new | ||||||||||||
| 8 | { | ||||||||||||
| 9 | 2392 | ▶ | my ($proto, $text ) = @_; | ||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 10 | 2392 | ▶ | $text //= ''; | ||||||||||
|
Condition100%2/2
$text //= ""
MC/DC100%1/1
$text //= ""
$text
Truth table100%2/2
A
A= $text
| |||||||||||||
| 11 | |||||||||||||
| 12 | 2392 | my $self = bless { | |||||||||||
| 13 | 'texts' => [$text] | ||||||||||||
| 14 | , '_template' => $DTL::Fast::Template::CURRENT_TEMPLATE | ||||||||||||
| 15 | , '_template_line' => $DTL::Fast::Template::CURRENT_TEMPLATE_LINE | ||||||||||||
| 16 | }, $proto; | ||||||||||||
| 17 | |||||||||||||
| 18 | 2392 | weaken $self->{'_template'}; | |||||||||||
| 19 | |||||||||||||
| 20 | 2392 | return $self; | |||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | sub append | ||||||||||||
| 24 | { | ||||||||||||
| 25 | 108 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
append: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 26 | 108 | ▶ | $self->{'need_join'} ||= 1; | ||||||||||
|
Condition100%2/2
$self->{"need_join"} ||= 1
MC/DC100%1/1
$self->{"need_join"} ||= 1
$self->{"need_join"}
Truth table100%2/2
A
A= $self->{"need_join"}
| |||||||||||||
| 27 | 108 | push @{$self->{'texts'}}, shift; | |||||||||||
| 28 | 108 | return $self; | |||||||||||
| 29 | } | ||||||||||||
| 30 | |||||||||||||
| 31 | sub render | ||||||||||||
| 32 | { | ||||||||||||
| 33 | 3078 | ▶ | my($self) = @_; | ||||||||||
|
Subroutine
render: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 34 | return $self->{'need_join'} | ||||||||||||
| 35 | 11 | ? join '', @{$self->{'texts'}} | |||||||||||
| 36 | 3078 | ▶ | : $self->{'texts'}->[0] | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 37 | ; | ||||||||||||
| 38 | } | ||||||||||||
| 39 | |||||||||||||
| 40 | |||||||||||||
| 41 | 98 | 1; | |||||||||||