summaryrefslogblamecommitdiff
path: root/lib/Net/HTTP/API/Parser/JSON.pm
blob: 2edc71c711aa4a396b6d2ab4ac3ad5774ecec68f (plain) (tree)
1
2
3
4
5
6
7
8
                                     
 

                      

          
                                 
 






                                               

                              
                                          



                              
                                          


  



                  
package Net::HTTP::API::Parser::JSON;

# ABSTRACT: Parse JSON

use JSON;
use Moose;
extends 'Net::HTTP::API::Parser';

has _json_parser => (
    is      => 'rw',
    isa     => 'JSON',
    lazy    => 1,
    default => sub { JSON->new->allow_nonref },
);

sub encode {
    my ($self, $content) = @_;
    $self->_json_parser->encode($content);
}

sub decode {
    my ($self, $content) = @_;
    $self->_json_parser->decode($content);
}

1;

=head1 SYNOPSIS

=head1 DESCRIPTION