| 1 | package Data::Encoder::Data::Dumper; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use Carp (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use Data::Dumper (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 2 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 9 | 2 | my ($class, $args) = @_; | |||||||||||
| 10 | 2 | ▶ | $args ||= {}; | ||||||||||
|
Condition100%2/2
$args ||= {}
MC/DC100%1/1
$args ||= {}
$args
Truth table100%2/2
A
A= $args
| |||||||||||||
| 11 | 2 | bless { %$args }, __PACKAGE__; | |||||||||||
| 12 | } | ||||||||||||
| 13 | |||||||||||||
| 14 | 2 | ▶ | sub encode { | ||||||||||
|
Subroutine
encode: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 15 | 2 | my ($self, $stuff, @args) = @_; | |||||||||||
| 16 | 2 | local $Data::Dumper::Terse = 1; | |||||||||||
| 17 | 2 | local $Data::Dumper::Purity = 1; | |||||||||||
| 18 | 2 | local $Data::Dumper::Indent = 0; | |||||||||||
| 19 | 2 | my $dumper = Data::Dumper->new([$stuff], @args); | |||||||||||
| 20 | 2 | for my $method (keys %$self) { | |||||||||||
| 21 | 1 | $dumper->$method($self->{$method}); | |||||||||||
| 22 | } | ||||||||||||
| 23 | 2 | return $dumper->Dump; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 2 | ▶ | sub decode { | ||||||||||
|
Subroutine
decode: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 27 | 2 | my ($self, $stuff, @args) = @_; | |||||||||||
| 28 | 2 | local $@; | |||||||||||
| 29 | 2 | my $res = eval $stuff; ## no critic | |||||||||||
| 30 | 2 | ▶ | Carp::croak $@ if $@; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | 2 | return $res; | |||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | 1 | 1; | |||||||||||
| 35 | __END__ | ||||||||||||