File Coverage

blib/lib/Session.pm
Criterion Covered Total %
statement 25 26 96.1
branch 4 6 66.6
condition n/a
subroutine 12 13 92.3
pod 10 10 100.0
total 51 55 92.7


line stmt bran cond sub pod time code
1             package Session;
2              
3 1     1   5930 use strict;
  1         2  
  1         29  
4 1     1   739 use Apache::Session::Flex;
  1         3214  
  1         28  
5 1     1   6 use base qw(Apache::Session::Flex);
  1         6  
  1         598  
6              
7             $Session::VERSION = 0.01;
8              
9             sub new
10             {
11 3     3 1 1599 my($class, $id, @args) = @_;
12 3         5 my $self;
13             eval
14 3         6 {
15 3 50       35 $self = $class->TIEHASH($id, (ref $args[0] ? $args[0] : {@args}));
16             };
17 3 100       201567 Session->error($@) if $@;
18 3         17 return $self;
19             }
20              
21 1     1 1 121 sub session_id {shift->FETCH('_session_id')}
22 2     2 1 1385 sub get {shift->FETCH(@_)}
23 1     1 1 54 sub set {shift->STORE(@_)}
24 1     1 1 62 sub remove {shift->DELETE(@_)}
25 0     0 1 0 sub clear {shift->CLEAR(@_)}
26 2     2 1 160 sub exists {shift->EXISTS(@_)}
27              
28 1     1 1 40 sub keys {grep $_ ne '_session_id', keys %{shift->{data}}}
  1         9  
29 1     1 1 3 sub release {undef($_[0])}
30              
31             sub error
32             {
33 1 50   1 1 5 $Session::ERROR = $_[1] if defined $_[1];
34 1         2 return $Session::ERROR;
35             }
36              
37             1;
38              
39             __END__