blib/lib/Dancer/Serializer/Abstract.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 5 totaltotal 87.5% 35 / 40 SCAR 6.9
CC
2
Cov
100%
support_content_type
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Dancer/Logger/Console.pm ↑ Summary blib/lib/Dancer/HTTP.pm »
1 package Dancer::Serializer::Abstract;
2 176 our $AUTHORITY = 'cpan:SUKRIA';
3 # ABSTRACT: Base serialiser class for Dancer
4 176 $Dancer::Serializer::Abstract::VERSION = '1.3520';
5 176 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 176 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 176 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 176 ▶use base 'Dancer::Engine';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶sub serialize { confess 'must be implemented' }
Subroutine serialize: called CC=1 SCAR=0.0
Pod undocumented
11 1 ▶sub deserialize { confess 'must be implemented' }
Subroutine deserialize: called CC=1 SCAR=0.0
Pod undocumented
12  
13 # must be implemented to declare if the serializer can be used or not
14 # most of the time, just use :
15 # Dancer::ModuleLoader->load('Your::Serializer::Deps');
16 1 ▶sub loaded {0}
Subroutine loaded: called CC=1 SCAR=0.0
Pod undocumented
17  
18 # should be implemented, fallback to text/plain if not
19 4 ▶sub content_type {'text/plain'}
Subroutine content_type: called CC=1 SCAR=0.0
Pod undocumented
20  
21 # most serializer don't have to overload this one
22 sub support_content_type {
23 30 ▶ my ($self, $ct) = @_;
Subroutine support_content_type: called CC=2 SCAR=6.9
Pod undocumented
24 30 ▶ return unless $ct;
Branch: 1 branch
BranchTrueFalseTotal
unless $ct 19 11 30
25 11 my @toks = split ';', $ct;
26 11 $ct = lc($toks[0]);
27 11 return $ct eq $self->content_type;
28 }
29  
30 176 1;
31  
32 __END__
« blib/lib/Dancer/Logger/Console.pm ↑ Summary blib/lib/Dancer/HTTP.pm »