Articulate/Serialisation/Asset.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 34.0% 15 / 44 CC 6 SCAR 33.4
CC
6
Cov
33%
serialise
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 28.3
« Articulate/Authorisation/Preconfigured.pm ↑ Summary Articulate/LocationSpecification.pm »
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}
Branch: 1 branch
BranchTrueFalseTotal
if ($response->data->{$type} and ref $response->data->{$type} eq ref {} and $response->data->{$type}{"schema"}{"core"}{"file"}) 0 0 0
Condition0%0/6
$response->data->{$type} and ref $response->data->{$type} eq ref {} and $response->data->{$type}{"schema"}{"core"}{"file"}
!ll&&!rl&&r
000
$response->data->{$type} and ref $response->data->{$type} eq ref {}
!ll&&!rl&&r
000
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"}
ABCresult
0XX0
10X0
1100
1111
25 and ref $response->data->{$type} eq ref {}
26 and $response->data->{$type}->{schema}->{core}->{file} )
27 {
28 my $content_type =
29 0 ▶ $response->data->{$type}->{schema}->{core}->{content_type} // $type;
Condition0%0/3
$response->data->{$type}{"schema"}{"core"}{"content_type"} // $type
l!l&&r!l&&!r
000
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
ABresult
1X1
011
000
30 0 $self->framework->set_content_type($content_type);
31 0 ▶ my $content = $response->data->{$type}->{content} // '';
Condition0%0/2
$response->data->{$type}{"content"} // ""
l!l
00
MC/DC0%0/1
$response->data->{$type}{"content"} // ""
$response->data->{$type}{"content"}
Truth table0%0/2
A
A= $response->data->{$type}{"content"}
Aresult
11
00
32 0 return $content;
33 }
34 0 return undef;
35 }
36  
37 1 1;
« Articulate/Authorisation/Preconfigured.pm ↑ Summary Articulate/LocationSpecification.pm »