SQLEngine/Cache/TrivialCache.pm

filter: Statementstmt 87.5% 7 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 5 / 5 totaltotal 88.8% 16 / 18 CC 1 SCAR 1.8
CC
1
Cov
88%
get_namespace
2.0
new
1.0
get
1.0
CRAP 1.2
« SQLEngine/Criteria/HashGroup.pm ↑ Summary SQLEngine.pm »
1 =head1 NAME
2  
3 DBIx::SQLEngine::Cache::TrivialCache - Trivial Cache Object
4  
5 =head1 SYNOPSIS
6  
7 use DBIx::SQLEngine::Cache::TrivialCache;
8  
9 $cache = DBIx::SQLEngine::Cache::TrivialCache->new();
10  
11 $cache->set( $key, $value );
12  
13 $value = $cache->get( $key );
14  
15 $cache->clear();
16  
17 =head1 DESCRIPTION
18  
19 This package provides a very, very simple cache implementation.
20 No expiration or pruning is performed.
21  
22 For a more full-featured cache, use one of the Cache::Cache classes.
23  
24 =cut
25  
26 package DBIx::SQLEngine::Cache::TrivialCache;
27  
28 ########################################################################
29  
30 =head1 CACHE INTERFACE
31  
32 =cut
33  
34 ########################################################################
35  
36 =head2 Constructor
37  
38 =over 4
39  
40 =item new()
41  
42 =back
43  
44 =cut
45  
46 1 ▶sub new { my $class = shift; bless { @_ }, $class }
Subroutine new: called CC=1 SCAR=0.0
Pod documented
47  
48 ########################################################################
49  
50 =head2 Accessors
51  
52 =over 4
53  
54 =item get_namespace()
55  
56 Returns nothing.
57  
58 =back
59  
60 =cut
61  
62 0 ▶sub get_namespace { "Trivial" }
Subroutine get_namespace: not called CC=1 SCAR=6.9
Pod documented
63  
64 ########################################################################
65  
66 =head2 Operations
67  
68 =over 4
69  
70 =item get()
71  
72 =item set()
73  
74 =item clear()
75  
76 =back
77  
78 =cut
79  
80 7 ▶sub get { ($_[0])->{ $_[1] } }
Subroutine get: called CC=1 SCAR=0.0
Pod documented
81  
82 4 ▶sub set { ($_[0])->{ $_[1] } = $_[2] }
Subroutine set: called CC=1 SCAR=0.0
Pod documented
83  
84 3 ▶sub clear { %{ $_[0] } = () }
Subroutine clear: called CC=1 SCAR=0.0
Pod documented
85  
86 ########################################################################
87  
88 ########################################################################
89  
90 =head1 SEE ALSO
91  
92 For a more full-featured cache, see L<Cache::Cache>.
93  
94 For more about the Cache classes, see L<DBIx::SQLEngine::Record::Trait::Cache>.
95  
96 For more about the Record classes, see L<DBIx::SQLEngine::Record::Class>.
97  
98 See L<DBIx::SQLEngine> for the overall interface and developer documentation.
99  
100 See L<DBIx::SQLEngine::Docs::ReadMe> for general information about
101 this distribution, including installation and license information.
102  
103 =cut
104  
105 ########################################################################
106  
107 1 1;
« SQLEngine/Criteria/HashGroup.pm ↑ Summary SQLEngine.pm »