| 1 | package Articulate::Serialisation::Asset; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | with 'Articulate::Role::Component'; | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | Articulate::Serialisation::Asset - return your asset as a file | ||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | =head1 METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | =head3 serialise | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | If the meta schema.core.file is true, send the file as a schema.core.content_type. | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | sub serialise { | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
serialise: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $response = shift; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | my $type = $response->type; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | if ( $response->data->{$type} and ref $response->data->{$type} eq ref {} and $response->data->{$type}->{schema}->{core}->{file} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$response->data->{$type} and ref $response->data->{$type} eq ref {} and $response->data->{$type}{"schema"}{"core"}{"file"}
$response->data->{$type} and ref $response->data->{$type} eq ref {}
MC/DC0%0/3
$response->data->{$type} and ref $response->data->{$type} eq ref {} and $response->data->{$type}{"schema"}{"core"}{"file"}
$response->data->{$type}
ref $response->data->{$type} eq ref {}
$response->data->{$type}{"schema"}{"core"}{"file"}
Truth table0%0/4
A and B and C
A= $response->data->{$type}B= ref $response->data->{$type} eq ref {}C= $response->data->{$type}{"schema"}{"core"}{"file"}
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | my $content_type = $response->data->{$type}->{schema}->{core}->{content_type} // $type ; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$response->data->{$type}{"schema"}{"core"}{"content_type"} // $type
MC/DC0%0/2
$response->data->{$type}{"schema"}{"core"}{"content_type"} // $type
$response->data->{$type}{"schema"}{"core"}{"content_type"}
$type
Truth table0%0/3
A // B
A= $response->data->{$type}{"schema"}{"core"}{"content_type"}B= $type
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | $self->framework->set_content_type ( $content_type ); | |||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | my $content = $response->data->{$type}->{content} // ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$response->data->{$type}{"content"} // ""
MC/DC0%0/1
$response->data->{$type}{"content"} // ""
$response->data->{$type}{"content"}
Truth table0%0/2
A
A= $response->data->{$type}{"content"}
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | return $content; | |||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||