| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Articulate::Serialisation::TemplateToolkit; | 
| 2 | 4 |  |  | 4 |  | 2202 | use strict; | 
|  | 4 |  |  |  |  | 7 |  | 
|  | 4 |  |  |  |  | 127 |  | 
| 3 | 4 |  |  | 4 |  | 16 | use warnings; | 
|  | 4 |  |  |  |  | 6 |  | 
|  | 4 |  |  |  |  | 103 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 4 |  |  | 4 |  | 18 | use Moo; | 
|  | 4 |  |  |  |  | 5 |  | 
|  | 4 |  |  |  |  | 20 |  | 
| 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; |