| 1 | package Clustericious::Coder::JSON; | ||
| 2 | |||
| 3 | 46 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 46 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 46 | ▶ | use JSON::MaybeXS (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 46 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | # ABSTRACT: JSON encoder for AutodataHandler | ||
| 9 | 46 | our $VERSION = '1.29'; # VERSION | |
| 10 | |||
| 11 | sub coder | ||
| 12 | 100 | ▶ | { |
|
Subroutine
coder: called CC=1 SCAR=0.1
Pod
undocumented
| |||
| 13 | 100 | my $json = JSON::MaybeXS->new | |
| 14 | ->allow_nonref | ||
| 15 | ->allow_blessed | ||
| 16 | ->convert_blessed; | ||
| 17 | |||
| 18 | my %coder = ( | ||
| 19 | type => 'application/json', | ||
| 20 | format => 'json', | ||
| 21 | 8 | ▶ | encode => sub { $json->encode($_[0]) }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 22 | 0 | ▶ | decode => sub { $json->decode($_[0]) }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 23 | 100 | ); | |
| 24 | |||
| 25 | 100 | \%coder; | |
| 26 | } | ||
| 27 | |||
| 28 | 46 | 1; | |
| 29 | |||
| 30 | __END__ | ||