File: JSON.pm

package info (click to toggle)
libchi-perl 0.58-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 660 kB
  • ctags: 421
  • sloc: perl: 5,496; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 441 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Default key serializer class, so that we don't have to depend on Data::Serializer.
# Recommend Data::Serializer for other serializers, rather than reinventing the wheel.
#
package CHI::Serializer::JSON;
{
  $CHI::Serializer::JSON::VERSION = '0.58';
}
use CHI::Util qw(json_encode json_decode);
use Moo;
use strict;
use warnings;

sub serialize {
    return json_encode( $_[1] );
}

sub deserialize {
    return json_decode( $_[1] );
}

1;