Group
Extension

Matches 1

WebApp-Helpers-JsonEncoder ( F/FE/FELLIOTT/WebApp-Helpers-JsonEncoder-0.01.tar.gz, FELLIOTT, 2014; MetaCPAN )
WebApp-Helpers-JsonEncoder/lib/WebApp/Helpers/JsonEncoder.pm ( view source; MetaCPAN )
pers::JsonEncoder;

use strict;
use warnings;

use JSON::MaybeXS qw(JSON);

use Moo::Role;

our $VERSION = "0.01";


has _json_encoder => (
   is => 'ro',
   lazy => 1,
   builder => '_build_json_enco
handles => {
      encode_json => 'encode',
      decode_json => 'decode',
   },
);
sub _build_json_encoder { JSON->new->utf8(1); }


sub json_bool { $_[1] ? JSON->true : JSON->false }


1;
__END__

=
ead1 NAME

WebApp::Helpers::JsonEncoder - Simple role for en/decoding JSON

=head1 SYNOPSIS

    package MyTunes::Resource::CD;

    use Moo;
    with 'WebApp::Helpers::JsonEncoder';

    has title   

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