line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tiffany::Text::Xslate; |
2
|
2
|
|
|
2
|
|
33899
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
75
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
60
|
|
4
|
2
|
|
|
2
|
|
16
|
use Text::Xslate 0.1056; |
|
2
|
|
|
|
|
48
|
|
|
2
|
|
|
|
|
365
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
5
|
|
|
5
|
0
|
128261
|
my ($class, $args) = @_; |
8
|
5
|
|
100
|
|
|
40
|
$args ||= +{}; |
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
|
|
41
|
my $xslate = Text::Xslate->new($args); |
11
|
5
|
|
|
|
|
1285
|
bless { |
12
|
|
|
|
|
|
|
xslate => $xslate, |
13
|
|
|
|
|
|
|
}, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub render { |
17
|
5
|
|
|
5
|
0
|
35
|
my ($self, $stuff, @args) = @_; |
18
|
|
|
|
|
|
|
|
19
|
5
|
100
|
|
|
|
15
|
if (ref $stuff) { |
20
|
3
|
|
|
|
|
44
|
return $self->{xslate}->render_string($$stuff, @args); |
21
|
|
|
|
|
|
|
} else { |
22
|
2
|
|
|
|
|
28
|
return $self->{xslate}->render($stuff, @args); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
__END__ |