rnings;
package Dancer2::Session::JSON;
# ABSTRACT: Dancer 2 session storage in files with JSON
our $VERSION = '0.003';
use Moo;
use Dancer2::Core::Types;
use JSON;
#------------------------------
=> 'ro',
isa => Str,
default => sub { ".json" },
);
has _encoder => (
is => 'lazy',
isa => InstanceOf ['JSON'],
handles => {
'_freeze' => 'encode',
'_thaw' => 'decode'
},
);
sub _build__encoder {
my ($self) = @_;
return JSON->new->allow_blessed->convert_blessed;
}
#---------------------------------------------------------------