| 1 | package Template::Mustache::Token::Verbatim; | ||||||||||
| 2 | 23 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | # ABSTRACT: Object representing a Verbatim block | ||||||||||
| 4 | 23 | $Template::Mustache::Token::Verbatim::VERSION = '1.4.0'; | |||||||||
| 5 | 23 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 23 | ▶ | use MooseX::MungeHas { has_ro => [ 'is_ro' ], has_rw => [ 'is_rw' ] }; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 23 | has_ro 'content'; | |||||||||
| 10 | 23 | has_rw 'last'; | |||||||||
| 11 | |||||||||||
| 12 | 145 | ▶ | sub render { | ||||||||
|
Subroutine
render: called CC=3 SCAR=15.7
Pod
undocumented
| |||||||||||
| 13 | 145 | my( $self, undef, undef, $indent ) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 145 | my $value = $self->content; | |||||||||
| 16 | |||||||||||
| 17 | 145 | ▶ | if( length $indent ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | ▶ | if ( $self->last ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | $value =~ s/(\r?\n)/$1$indent/gm; | |||||||||
| 20 | 0 | $value =~ s/(\r?\n)$indent$/$1/; | |||||||||
| 21 | } | ||||||||||
| 22 | else { | ||||||||||
| 23 | 0 | $value =~ s/(\r?\n)/$1$indent/gm; | |||||||||
| 24 | } | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 145 | return $value; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 23 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||