| 1 | # | ||||||||||||
| 2 | # This file is part of Jedi-Plugin-Session | ||||||||||||
| 3 | # | ||||||||||||
| 4 | # This software is copyright (c) 2013 by celogeek <me@celogeek.com>. | ||||||||||||
| 5 | # | ||||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||
| 8 | # | ||||||||||||
| 9 | package Jedi::Plugin::Session::Role::Redis; | ||||||||||||
| 10 | |||||||||||||
| 11 | # ABSTRACT: Redis Backend | ||||||||||||
| 12 | |||||||||||||
| 13 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | 1 | our $VERSION = '0.05'; # VERSION | |||||||||||
| 16 | |||||||||||||
| 17 | 1 | ▶ | use Jedi::Plugin::Session::Backend::Redis; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 1 | ▶ | use Moo::Role; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | |||||||||||||
| 20 | 0 | ▶ | sub _build__jedi_session { | ||||||||||
|
Subroutine
_build__jedi_session: not called CC=2 SCAR=17.9
| |||||||||||||
| 21 | 0 | my ($self) = @_; | |||||||||||
| 22 | 0 | my $class = ref $self; | |||||||||||
| 23 | my $expires_in = $self->jedi_config->{$class}{session}{expiration} | ||||||||||||
| 24 | 0 | ▶ | // '3 hours'; | ||||||||||
|
Condition0%0/2
$self->jedi_config->{$class}{"session"}{"expiration"} // "3 hours"
MC/DC0%0/1
$self->jedi_config->{$class}{"session"}{"expiration"} // "3 hours"
$self->jedi_config->{$class}{"session"}{"expiration"}
Truth table0%0/2
A
A= $self->jedi_config->{$class}{"session"}{"expiration"}
| |||||||||||||
| 25 | 0 | my $redis_config = $self->jedi_config->{$class}{session}{redis}{config}; | |||||||||||
| 26 | 0 | my $redis_prefix = $self->jedi_config->{$class}{session}{redis}{prefix}; | |||||||||||
| 27 | 0 | return Jedi::Plugin::Session::Backend::Redis->new( | |||||||||||
| 28 | config => $redis_config, | ||||||||||||
| 29 | expires_in => $expires_in, | ||||||||||||
| 30 | prefix => $redis_prefix | ||||||||||||
| 31 | ); | ||||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | 1 | 1; | |||||||||||
| 35 | |||||||||||||
| 36 | __END__ | ||||||||||||