blib/lib/Data/Encoder/YAML.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 15 | 15 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 6 | 6 | 100.0 |
pod | 0 | 3 | 0.0 |
total | 21 | 24 | 87.5 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Data::Encoder::YAML; | ||||||
2 | |||||||
3 | 1 | 1 | 698 | use strict; | |||
1 | 2 | ||||||
1 | 42 | ||||||
4 | 1 | 1 | 4 | use warnings; | |||
1 | 3 | ||||||
1 | 28 | ||||||
5 | 1 | 1 | 12 | use YAML (); | |||
1 | 3 | ||||||
1 | 125 | ||||||
6 | |||||||
7 | sub new { | ||||||
8 | 1 | 1 | 0 | 1024 | my ($class, $args) = @_; | ||
9 | 1 | 6 | bless \my $obj, __PACKAGE__; | ||||
10 | } | ||||||
11 | |||||||
12 | sub encode { | ||||||
13 | 1 | 1 | 0 | 8 | my ($self, $stuff, @args) = @_; | ||
14 | 1 | 6 | YAML::Dump($stuff); | ||||
15 | } | ||||||
16 | |||||||
17 | sub decode { | ||||||
18 | 1 | 1 | 0 | 703 | my ($self, $stuff, @args) = @_; | ||
19 | 1 | 5 | YAML::Load($stuff); | ||||
20 | } | ||||||
21 | |||||||
22 | 1; | ||||||
23 | __END__ |