line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Articulate::Serialisation::TemplateToolkit; |
2
|
6
|
|
|
6
|
|
3349
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
218
|
|
3
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
140
|
|
4
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
23
|
use Moo; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
31
|
|
6
|
|
|
|
|
|
|
with 'Articulate::Role::Component'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Articulate::Serialisation::TemplateToolkit - put your response into a TT2 template |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 METHODS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head3 serialise |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Finds the template corresponding to the response type and processes it, passing in the response data. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub serialise { |
21
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
22
|
0
|
|
|
|
|
|
my $response = shift; |
23
|
0
|
|
|
|
|
|
return $self->framework->template_process( $response->type, $response->data ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |