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