File Coverage

blib/lib/HTML/Template/Dumper/YAML.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition 2 4 50.0
subroutine 6 6 100.0
pod 0 2 0.0
total 26 30 86.6


line stmt bran cond sub pod time code
1              
2             =head1 COPYRIGHT
3              
4             Copyright 2003, American Society of Agronomy. All rights reserved.
5              
6             This program is free software; you can redistribute it and/or modify
7             it under the terms of either:
8              
9             a) the GNU General Public License as published by the Free Software
10             Foundation; either version 2, or (at your option) any later version, or
11              
12             b) the "Artistic License" which comes with Perl.
13              
14             =cut
15              
16              
17             package HTML::Template::Dumper::YAML;
18 2     2   11269 use strict;
  2         4  
  2         67  
19 2     2   11 use warnings;
  2         4  
  2         45  
20 2     2   15 use YAML;
  2         4  
  2         113  
21 2     2   12 use base 'HTML::Template::Dumper::Format';
  2         4  
  2         417  
22              
23             our $VERSION = 0.1;
24              
25              
26             sub dump
27             {
28 14     14 0 24 my $self = shift;
29 14   50     29 my $ref = shift || return;
30              
31 14         33 return Dump( $ref );
32             }
33              
34             sub parse
35             {
36 1     1 0 3 my $self = shift;
37 1   50     5 my $data = shift || return;
38            
39 1         5 return Load( $data );
40             }
41              
42              
43             1;
44             __END__