| 1 | package Net::HTTP::API::Parser::JSON; | ||
| 2 | 3 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 3 | $Net::HTTP::API::Parser::JSON::VERSION = '0.14'; | |
| 4 | } | ||
| 5 | |||
| 6 | # ABSTRACT: Parse JSON | ||
| 7 | |||
| 8 | 3 | ▶ | use JSON; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 3 | extends 'Net::HTTP::API::Parser'; | |
| 11 | |||
| 12 | has _json_parser => ( | ||
| 13 | is => 'rw', | ||
| 14 | isa => 'JSON', | ||
| 15 | lazy => 1, | ||
| 16 | 3 | ▶ | default => sub { JSON->new->allow_nonref }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 17 | 3 | ); | |
| 18 | |||
| 19 | 3 | ▶ | sub encode { |
|
Subroutine
encode: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 20 | 3 | my ($self, $content) = @_; | |
| 21 | 3 | $self->_json_parser->encode($content); | |
| 22 | } | ||
| 23 | |||
| 24 | 6 | ▶ | sub decode { |
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 25 | 6 | my ($self, $content) = @_; | |
| 26 | 6 | $self->_json_parser->decode($content); | |
| 27 | } | ||
| 28 | |||
| 29 | 3 | 1; | |
| 30 | |||
| 31 | |||
| 32 | __END__ | ||