| 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 | 378 | use strict; | |||
| 1 | 1 | ||||||
| 1 | 25 | ||||||
| 4 | 1 | 1 | 3 | use warnings; | |||
| 1 | 2 | ||||||
| 1 | 21 | ||||||
| 5 | 1 | 1 | 6 | use YAML (); | |||
| 1 | 2 | ||||||
| 1 | 84 | ||||||
| 6 | |||||||
| 7 | sub new { | ||||||
| 8 | 1 | 1 | 0 | 567 | my ($class, $args) = @_; | ||
| 9 | 1 | 3 | bless \my $obj, __PACKAGE__; | ||||
| 10 | } | ||||||
| 11 | |||||||
| 12 | sub encode { | ||||||
| 13 | 1 | 1 | 0 | 5 | my ($self, $stuff, @args) = @_; | ||
| 14 | 1 | 4 | YAML::Dump($stuff); | ||||
| 15 | } | ||||||
| 16 | |||||||
| 17 | sub decode { | ||||||
| 18 | 1 | 1 | 0 | 487 | my ($self, $stuff, @args) = @_; | ||
| 19 | 1 | 4 | YAML::Load($stuff); | ||||
| 20 | } | ||||||
| 21 | |||||||
| 22 | 1; | ||||||
| 23 | __END__ |