line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Mustache::Token::Partial; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Object representing a Partial block |
4
|
|
|
|
|
|
|
$Template::Mustache::Token::Partial::VERSION = '1.3.3'; |
5
|
20
|
|
|
20
|
|
132
|
use Moo; |
|
20
|
|
|
|
|
45
|
|
|
20
|
|
|
|
|
127
|
|
6
|
|
|
|
|
|
|
|
7
|
20
|
|
|
20
|
|
8163
|
use MooseX::MungeHas { has_ro => [ 'is_ro' ], has_rw => [ 'is_rw' ] }; |
|
20
|
|
|
|
|
45
|
|
|
20
|
|
|
|
|
201
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has_ro 'name'; |
10
|
|
|
|
|
|
|
has_rw 'indent'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub render { |
13
|
16
|
|
|
16
|
0
|
41
|
my( $self, $context, $partials ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
16
|
|
|
|
|
29
|
my $partial; |
16
|
|
|
|
|
|
|
|
17
|
16
|
100
|
|
|
|
57
|
if ( ref $partials eq 'CODE' ) { |
18
|
11
|
50
|
|
|
|
68
|
my $template = $partials->($self->name) |
19
|
|
|
|
|
|
|
or return ''; |
20
|
|
|
|
|
|
|
|
21
|
11
|
100
|
|
|
|
164
|
$partial = ref $template ? $template : Template::Mustache->new( template => $template )->parsed; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
else { |
24
|
5
|
50
|
|
|
|
26
|
$partial = $partials->{$self->name} or return ''; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
16
|
100
|
|
|
|
145
|
if( ref $partial eq 'Template::Mustache' ) { |
28
|
7
|
|
|
|
|
119
|
$partials = $partial->partials; |
29
|
7
|
|
|
|
|
124
|
$partial = $partial->parsed; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
16
|
|
|
|
|
642
|
return $partial->render( $context, $partials, $self->indent ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=encoding UTF-8 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Template::Mustache::Token::Partial - Object representing a Partial block |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
version 1.3.3 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHORS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=over 4 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item * |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Pieter van de Bruggen <pvande@cpan.org> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item * |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Ricardo Signes <rjbs@cpan.org> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=back |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This software is copyright (c) 2019, 2018, 2017, 2016, 2015, 2011 by Pieter van de Bruggen. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
74
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |