| 1 | package String::Secret::Serializable; | ||||||||||
| 2 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 5 | ▶ | use parent qw/String::Secret/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 0 | ▶ | sub to_serializable { shift } | ||||||||
|
Subroutine
to_serializable: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 8 | |||||||||||
| 9 | # for Storable | ||||||||||
| 10 | 2 | ▶ | sub STORABLE_freeze { | ||||||||
|
Subroutine
STORABLE_freeze: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 11 | 2 | my ($self, $cloning) = @_; | |||||||||
| 12 | 2 | ▶ | return $self->SUPER::STORABLE_freeze($cloning) if $cloning; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 1 | return $self->unwrap; | |||||||||
| 14 | } | ||||||||||
| 15 | 2 | ▶ | sub STORABLE_thaw { | ||||||||
|
Subroutine
STORABLE_thaw: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | 2 | my ($self, $cloning, $raw) = @_; | |||||||||
| 17 | 2 | return $self->SUPER::STORABLE_thaw(1, $raw); # force cloging to set REAL secret | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | # for JSON modules | ||||||||||
| 21 | 1 | ▶ | sub TO_JSON { shift->unwrap } | ||||||||
|
Subroutine
TO_JSON: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 22 | |||||||||||
| 23 | # for CBOR | ||||||||||
| 24 | 0 | ▶ | sub TO_CBOR { shift->unwrap } | ||||||||
|
Subroutine
TO_CBOR: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 25 | |||||||||||
| 26 | # for JSON, CBOR, Sereal, ... | ||||||||||
| 27 | 0 | ▶ | sub FREEZE { | ||||||||
|
Subroutine
FREEZE: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 28 | 0 | my ($self, $serialiser) = @_; | |||||||||
| 29 | 0 | return $self->unwrap; | |||||||||
| 30 | } | ||||||||||
| 31 | 0 | ▶ | sub THAW { | ||||||||
|
Subroutine
THAW: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | 0 | my ($class, $serialiser, $raw) = @_; | |||||||||
| 33 | 0 | return $class->new($raw); | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 5 | 1; | |||||||||
| 37 | __END__ | ||||||||||