GX
(
J/JA/JAU/GX/GX-0.2000_01.tar.gz, JAU, 2011;
MetaCPAN
)
zer/JSON.pm
# ----------------------------------------------------------------------------------------------------------------------
package GX::Serializer::JSON;
use GX::Exception ();
use JSON ();
----
sub serialize {
my $self = shift;
my $data = shift;
my $string = eval { JSON::encode_json( $data ) };
if ( $@ ) {
GX::Exception->complain(
message =>
sub unserialize {
my $self = shift;
my $string = shift;
my $data = eval { JSON::decode_json( $string ) };
if ( $@ ) {
GX::Exception->complain(
message =