| 1 | package Articulate::Serialisation::TemplateToolkit; | ||
| 2 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 4 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 4 | 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 | ▶ | my $self = shift; |
|
Subroutine
serialise: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 22 | 0 | my $response = shift; | |
| 23 | 0 | return $self->framework->template_process( $response->type, $response->data ); | |
| 24 | } | ||
| 25 | |||
| 26 | 4 | 1; | |