File Coverage

blib/lib/Dancer/Session/PSGI.pm
Criterion Covered Total %
statement 12 23 52.1
branch n/a
condition n/a
subroutine 4 9 44.4
pod 5 5 100.0
total 21 37 56.7


line stmt bran cond sub pod time code
1             package Dancer::Session::PSGI;
2              
3             # ABSTRACT: Let Plack::Middleware::Session handle Dancer's session
4              
5 1     1   30975 use strict;
  1         3  
  1         41  
6 1     1   6 use warnings;
  1         1  
  1         49  
7             our $VERSION = '0.01';
8              
9 1     1   1663 use Dancer::SharedData;
  1         259034  
  1         45  
10 1     1   11 use base 'Dancer::Session::Abstract';
  1         3  
  1         1634  
11              
12             # session_name can't be set in config for this module
13             sub session_name {
14 0     0 1   "plack_session";
15             }
16              
17             sub create {
18 0     0 1   return Dancer::Session::PSGI->new();
19             }
20              
21             sub retrieve {
22 0     0 1   my ($class, $id) = @_;
23 0           my $session = Dancer::SharedData->request->{env}->{'psgix.session'};
24 0           return Dancer::Session::PSGI->new(%$session);
25             }
26              
27             sub flush {
28 0     0 1   my $self = shift;
29 0           my $session = Dancer::SharedData->request->{env}->{'psgix.session'};
30 0           map {$session->{$_} = $self->{$_}} keys %$self;
  0            
31 0           return $self;
32             }
33              
34 0     0 1   sub destroy {
35             }
36              
37             1;
38              
39              
40             __END__