Group
Extension

Matches 2

Hoppy ( M/MI/MIKI/Hoppy-0.01005.tar.gz, MIKI, 2009; MetaCPAN )
Hoppy/lib/Hoppy/Formatter/JSON.pm ( view source; MetaCPAN )
Hoppy::Formatter::JSON;
use strict;
use warnings;
use base qw( Hoppy::Base );
use Encode;
use JSON;

sub serialize {
    my ( $self, $data, $code ) = @_;
    my $json = JSON::to_json($data);
    if ( 
     utf8::decode($json);
    }
    return $json;
}

sub deserialize {
    my ( $self, $json, $code ) = @_;
    $json = decode( "utf8", $json );
    my $data = JSON::from_json($json);
    return $data
ormatter::JSON - IO formatter that can translate from or to JSON. 

=head1 SYNOPSIS

  use Hoppy::Formatter::JSON;

  my $formatter = Hoppy::Formatter::JSON->new;

  # from perl data to JSON
  my $dat
Hoppy ( M/MI/MIKI/Hoppy-0.01005.tar.gz, MIKI, 2009; MetaCPAN )
Hoppy/lib/Hoppy.pm ( view source; MetaCPAN )
ter
    {
        my $class = $self->config->{Formatter}
          || __PACKAGE__ . '::Formatter::JSON';
        $class->require or croak $@;
        $self->formatter( $class->new( context => $self ) 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.