blib/lib/Sentry/Cache.pm untested

filter: Statementstmt 0.0% 0 / 10 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 20 CC 1 SCAR 6.9
CC
1
Cov
0%
get_instance
2.0
set
2.0
get
2.0
CRAP 2.0
1 package Sentry::Cache;
2 use Mojo::Base -base, -signatures;
3  
4 has _cache => sub { {} };
5  
6 my $Instance;
7  
8 sub get_instance ($package) {
9 $Instance //= $package->new;
10 return $Instance;
11 }
12  
13 sub set ($self, $key, $value) {
14 $self->_cache->{$key} = $value;
15 }
16  
17 sub get ($self, $key) {
18 return $self->_cache->{$key};
19 }
20  
21 1;