| 1 | package TOON; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use v5.40; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use feature 'signatures'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use TOON::PP (); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 5 | our $VERSION = '0.0.1'; | |||||||||||||||||||||||||||||||
| 10 | 5 | our @EXPORT_OK = qw( | |||||||||||||||||||||||||||||||
| 11 | encode_toon decode_toon | ||||||||||||||||||||||||||||||||
| 12 | to_toon from_toon | ||||||||||||||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | ▶ | sub encode_toon ($data, %opts) { | |||||||||||||||||||||||||||||||
|
Subroutine
encode_toon: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 16 | 1 | return TOON::PP->new(%opts)->encode($data); | |||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | ▶ | sub decode_toon ($text, %opts) { | |||||||||||||||||||||||||||||||
|
Subroutine
decode_toon: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 20 | 1 | return TOON::PP->new(%opts)->decode($text); | |||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub to_toon ($data, %opts) { return encode_toon($data, %opts) } | ||||||||||||||||||||||||||||||
|
Subroutine
to_toon: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub from_toon ($text, %opts) { return decode_toon($text, %opts) } | ||||||||||||||||||||||||||||||
|
Subroutine
from_toon: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | ▶ | sub new ($class, %opts) { | |||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=16.6
Pod
documented
| |||||||||||||||||||||||||||||||||
| 27 | return bless { | ||||||||||||||||||||||||||||||||
| 28 | pretty => $opts{pretty} // 0, | ||||||||||||||||||||||||||||||||
| 29 | canonical => $opts{canonical} // 0, | ||||||||||||||||||||||||||||||||
| 30 | 2 | ▶ | indent => $opts{indent} // 2, | ||||||||||||||||||||||||||||||
|
Condition50%3/6
$opts{"pretty"} // 0
$opts{"canonical"} // 0
$opts{"indent"} // 2
MC/DC0%0/1
$opts{"pretty"} // 0
$opts{"pretty"}
MC/DC0%0/1
$opts{"canonical"} // 0
$opts{"canonical"}
MC/DC0%0/1
$opts{"indent"} // 2
$opts{"indent"}
Truth table50%1/2
A
A= $opts{"pretty"}
Truth table50%1/2
A
A= $opts{"canonical"}
Truth table50%1/2
A
A= $opts{"indent"}
| |||||||||||||||||||||||||||||||||
| 31 | }, $class; | ||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||
| 34 | ▶ | sub encode ($self, $data) { | |||||||||||||||||||||||||||||||
|
Subroutine
encode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 35 | 1 | return TOON::PP->new(%$self)->encode($data); | |||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | ▶ | sub decode ($self, $text) { | |||||||||||||||||||||||||||||||
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 39 | 2 | return TOON::PP->new(%$self)->decode($text); | |||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||
| 42 | 1 | ▶ | sub pretty ($self, $value = 1) { | ||||||||||||||||||||||||||||||
|
Subroutine
pretty: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 43 | 1 | $self->{pretty} = $value; | |||||||||||||||||||||||||||||||
| 44 | 1 | return $self; | |||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||
| 47 | 1 | ▶ | sub canonical ($self, $value = 1) { | ||||||||||||||||||||||||||||||
|
Subroutine
canonical: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 48 | 1 | $self->{canonical} = $value; | |||||||||||||||||||||||||||||||
| 49 | 1 | return $self; | |||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | ▶ | sub indent ($self, $value) { | |||||||||||||||||||||||||||||||
|
Subroutine
indent: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | $self->{indent} = $value if defined $value; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 54 | 0 | return $self; | |||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||
| 57 | 5 | 1; | |||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | __END__ | ||||||||||||||||||||||||||||||||