Ark
(
S/SO/SONGMU/Ark-1.22.tar.gz, SONGMU, 2020;
MetaCPAN
)
package Ark::View::JSON;
use strict;
use warnings;
use Ark 'View';
use JSON;
has allow_callback => (
is => 'rw',
isa => 'Bool',
default => 0,
);
has callback_param => (
is
;
has json_driver => (
is => 'rw',
isa => 'Object',
lazy => 1,
default => sub {
my $self = shift;
JSON->new->utf8->allow_nonref;
},
);
has json_dumper
'CodeRef',
lazy => 1,
default => sub {
my $self = shift;
sub { $self->json_driver->encode(@_) };
},
);
has status_code_field => (
is => 'ro',
isa => "Str",
);