| 1 | package PX::API::Response::JSON; | ||
| 2 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 2 | ▶ | use version; our $VERSION = qv('0.0.3'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 0 | ▶ | use JSON; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 9 | |||
| 10 | sub new { | ||
| 11 | my $class = shift; | ||
| 12 | my $args = shift; | ||
| 13 | |||
| 14 | $class = ref($class) || $class; | ||
| 15 | my $self = bless {}, $class; | ||
| 16 | |||
| 17 | $self->{'xs'} = JSON->new(); | ||
| 18 | return $self; | ||
| 19 | } | ||
| 20 | |||
| 21 | sub parse { | ||
| 22 | my $self = shift; | ||
| 23 | my $json = shift; | ||
| 24 | |||
| 25 | my $xs = $self->{'xs'}; | ||
| 26 | my $ref = $xs->jsonToObj($json); | ||
| 27 | return $ref; | ||
| 28 | } | ||
| 29 | |||
| 30 | sub format { 'json' } | ||
| 31 | |||
| 32 | |||
| 33 | 1; | ||
| 34 | __END__ | ||