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.4'; |
5
|
20
|
|
|
20
|
|
126
|
use Moo; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
108
|
|
6
|
|
|
|
|
|
|
|
7
|
20
|
|
|
20
|
|
7863
|
use MooseX::MungeHas { has_ro => [ 'is_ro' ], has_rw => [ 'is_rw' ] }; |
|
20
|
|
|
|
|
47
|
|
|
20
|
|
|
|
|
176
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has_ro 'name'; |
10
|
|
|
|
|
|
|
has_rw 'indent'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub render { |
13
|
16
|
|
|
16
|
0
|
38
|
my( $self, $context, $partials ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
16
|
|
|
|
|
26
|
my $partial; |
16
|
|
|
|
|
|
|
|
17
|
16
|
100
|
|
|
|
48
|
if ( ref $partials eq 'CODE' ) { |
18
|
11
|
50
|
|
|
|
48
|
my $template = $partials->($self->name) |
19
|
|
|
|
|
|
|
or return ''; |
20
|
|
|
|
|
|
|
|
21
|
11
|
100
|
|
|
|
158
|
$partial = ref $template ? $template : Template::Mustache->new( template => $template )->parsed; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
else { |
24
|
5
|
50
|
|
|
|
31
|
$partial = $partials->{$self->name} or return ''; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
16
|
100
|
|
|
|
249
|
if( ref $partial eq 'Template::Mustache' ) { |
28
|
7
|
|
|
|
|
104
|
$partials = $partial->partials; |
29
|
7
|
|
|
|
|
138
|
$partial = $partial->parsed; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
16
|
|
|
|
|
881
|
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.4 |
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) 2021, 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 |