| 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.3.3'; | |||||||||
| 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 | sub render { | ||||||||||
| 13 | 145 | ▶ | my( $self, undef, undef, $indent ) = @_; | ||||||||
|
Subroutine
render: called CC=3 SCAR=15.7
Pod
undocumented
| |||||||||||
| 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__ | ||||||||||
| 33 | |||||||||||
| 34 | =pod | ||||||||||
| 35 | |||||||||||
| 36 | =encoding UTF-8 | ||||||||||
| 37 | |||||||||||
| 38 | =head1 NAME | ||||||||||
| 39 | |||||||||||
| 40 | Template::Mustache::Token::Verbatim - Object representing a Verbatim block | ||||||||||
| 41 | |||||||||||
| 42 | =head1 VERSION | ||||||||||
| 43 | |||||||||||
| 44 | version 1.3.3 | ||||||||||
| 45 | |||||||||||
| 46 | =head1 AUTHORS | ||||||||||
| 47 | |||||||||||
| 48 | =over 4 | ||||||||||
| 49 | |||||||||||
| 50 | =item * | ||||||||||
| 51 | |||||||||||
| 52 | Pieter van de Bruggen <pvande@cpan.org> | ||||||||||
| 53 | |||||||||||
| 54 | =item * | ||||||||||
| 55 | |||||||||||
| 56 | Yanick Champoux <yanick@cpan.org> | ||||||||||
| 57 | |||||||||||
| 58 | =item * | ||||||||||
| 59 | |||||||||||
| 60 | Ricardo Signes <rjbs@cpan.org> | ||||||||||
| 61 | |||||||||||
| 62 | =back | ||||||||||
| 63 | |||||||||||
| 64 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 65 | |||||||||||
| 66 | This software is copyright (c) 2019, 2018, 2017, 2016, 2015, 2011 by Pieter van de Bruggen. | ||||||||||
| 67 | |||||||||||
| 68 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 69 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 70 | |||||||||||
| 71 | =cut | ||||||||||