| 1 | package Template::Reverse::Converter::TT2; | ||||||||||
| 2 | |||||||||||
| 3 | # ABSTRACT: Convert parts to TT2 format simply | ||||||||||
| 4 | |||||||||||
| 5 | 4 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 4 | ▶ | use Scalar::Util qw(blessed); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 4 | our $VERSION = '0.143'; # VERSION | |||||||||
| 8 | |||||||||||
| 9 | sub Convert{ | ||||||||||
| 10 | 10 | ▶ | my $self = shift; | ||||||||
|
Subroutine
Convert: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 11 | 10 | my $parts = shift; | |||||||||
| 12 | 10 | my @temps; | |||||||||
| 13 | |||||||||||
| 14 | 10 | foreach my $pat (@{$parts}){ | |||||||||
| 15 | 15 | my @pre = @{$pat->pre}; | |||||||||
| 16 | 15 | my @post = @{$pat->post}; | |||||||||
| 17 | |||||||||||
| 18 | 15 | ▶ | @pre = map{blessed($_)?$_->as_string:$_}@pre; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 15 | ▶ | @post= map{blessed($_)?$_->as_string:$_}@post; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 15 | my $pretxt = join '',@pre; | |||||||||
| 21 | 15 | my $posttxt = join '',@post; | |||||||||
| 22 | 15 | ▶ | $pretxt .= '' if $pretxt; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 15 | ▶ | $posttxt = ''.$posttxt if $posttxt; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 15 | push(@temps,$pretxt."[\% value \%]".$posttxt); | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 10 | return \@temps; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | |||||||||||
| 32 | 4 | 1; | |||||||||
| 33 | |||||||||||
| 34 | __END__ | ||||||||||