File Coverage

blib/lib/Raisin/Encoder/YAML.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 4 0.0
total 24 28 85.7


line stmt bran cond sub pod time code
1             #!perl
2             #PODNAME: Raisin::Encoder::YAML
3             #ABSTRACT: YAML serialization plugin for Raisin.
4              
5 6     6   2614 use strict;
  6         10  
  6         165  
6 6     6   26 use warnings;
  6         9  
  6         284  
7              
8             package Raisin::Encoder::YAML;
9             $Raisin::Encoder::YAML::VERSION = '0.94';
10 6     6   32 use Encode qw(encode_utf8 decode_utf8);
  6         8  
  6         333  
11 6     6   453 use YAML qw(Dump Load);
  6         5932  
  6         902  
12              
13 71     71 0 229 sub detectable_by { [qw(application/x-yaml application/yaml text/x-yaml text/yaml yaml)] }
14 30     30 0 568 sub content_type { 'application/x-yaml' }
15 30     30 0 179 sub serialize { encode_utf8( Dump($_[1]) ) }
16 8     8 0 20 sub deserialize { Load( decode_utf8($_[1]->content) ) }
17              
18             1;
19              
20             __END__