| 1 | # Default key serializer class, so that we don't have to depend on Data::Serializer. | ||
| 2 | # Recommend Data::Serializer for other serializers, rather than reinventing the wheel. | ||
| 3 | # | ||
| 4 | package CHI::Serializer::JSON; | ||
| 5 | 20 | $CHI::Serializer::JSON::VERSION = '0.59'; | |
| 6 | 20 | ▶ | use CHI::Util qw(json_encode json_decode); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 20 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 20 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 20 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | sub serialize { | ||
| 12 | 768 | ▶ | return json_encode( $_[1] ); |
|
Subroutine
serialize: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 13 | } | ||
| 14 | |||
| 15 | sub deserialize { | ||
| 16 | 0 | ▶ | return json_decode( $_[1] ); |
|
Subroutine
deserialize: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 17 | } | ||
| 18 | |||
| 19 | 20 | 1; | |