Group
Extension

Matches 1

Dancer2-Serializer-JSONMaybeXS ( D/DB/DBOOK/Dancer2-Serializer-JSONMaybeXS-0.003.tar.gz, DBOOK, 2016; MetaCPAN )
Dancer2-Serializer-JSONMaybeXS/lib/Dancer2/Serializer/JSONMaybeXS.pm ( view source; MetaCPAN )
2::Serializer::JSONMaybeXS;

use Moo;
use JSON::MaybeXS ();

our $VERSION = '0.003';

with 'Dancer2::Core::Role::Serializer';

has '+content_type' => ( default => sub {'application/json;charset=UTF-8'
} );

sub BUILD {
	warnings::warnif('deprecated',
		'Dancer2::Serializer::JSONMaybeXS is deprecated and should no longer be used');
}

sub serialize {
	my ($self, $entity, $options) = @_;
	
	my $confi
tions->{utf8};
	
	JSON::MaybeXS->new($options)->encode($entity);
}

sub deserialize {
	my ($self, $entity, $options) = @_;
	
	$options->{utf8} = 1 if !defined $options->{utf8};
	JSON::MaybeXS->new($op

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.