| 1 | package WWW::Snooze::Serialize::JSON; | ||
| 2 | |||
| 3 | 3 | ▶ | use base 'WWW::Snooze::Serialize'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 5 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 9 | 5 | my $class = shift; | |
| 10 | 5 | my %args = @_; | |
| 11 | |||
| 12 | 5 | bless { | |
| 13 | extension => 'json', | ||
| 14 | mime => 'application/json', | ||
| 15 | %args | ||
| 16 | }, $class; | ||
| 17 | } | ||
| 18 | |||
| 19 | 0 | ▶ | sub encode { |
|
Subroutine
encode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 20 | 0 | my ($self, $input) = @_; | |
| 21 | 0 | my $output = JSON->new->allow_nonref->encode($input); | |
| 22 | 0 | return $output; | |
| 23 | } | ||
| 24 | |||
| 25 | 0 | ▶ | sub decode { |
|
Subroutine
decode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 26 | 0 | my ($self, $input) = @_; | |
| 27 | 0 | my $output = JSON->new->allow_nonref->decode($input); | |
| 28 | 0 | return $output; | |
| 29 | } | ||
| 30 | |||
| 31 | 3 | 1; | |