| blib/lib/Data/Encoder/Custom.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 13 | 13 | 100.0 |
| branch | n/a | ||
| condition | 1 | 2 | 50.0 |
| subroutine | 5 | 5 | 100.0 |
| pod | 0 | 3 | 0.0 |
| total | 19 | 23 | 82.6 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Data::Encoder::Custom; | ||||||
| 2 | |||||||
| 3 | 1 | 1 | 451 | use strict; | |||
| 1 | 1 | ||||||
| 1 | 21 | ||||||
| 4 | 1 | 1 | 3 | use warnings; | |||
| 1 | 1 | ||||||
| 1 | 106 | ||||||
| 5 | |||||||
| 6 | sub new { | ||||||
| 7 | 1 | 1 | 0 | 704 | my ($class, $args) = @_; | ||
| 8 | 1 | 50 | 5 | $args ||= {}; | |||
| 9 | 1 | 5 | bless { %$args }, __PACKAGE__; | ||||
| 10 | } | ||||||
| 11 | |||||||
| 12 | sub encode { | ||||||
| 13 | 1 | 1 | 0 | 5 | my ($self, $stuff, @args) = @_; | ||
| 14 | 1 | 5 | $self->{encoder}->($stuff, @args); | ||||
| 15 | } | ||||||
| 16 | |||||||
| 17 | sub decode { | ||||||
| 18 | 1 | 1 | 0 | 422 | my ($self, $stuff, @args) = @_; | ||
| 19 | 1 | 3 | $self->{decoder}->($stuff, @args); | ||||
| 20 | } | ||||||
| 21 | |||||||
| 22 | 1; | ||||||
| 23 | __END__ |