Config/DB/Mem.pm

filter: Statementstmt 68.0% 17 / 25 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 100% 1 / 1 totaltotal 59.4% 22 / 37 CC 3 SCAR 15.9
CC
3
Cov
59%
isset
12.0
set
2.0
get
2.0
CRAP 4.9
« Config/DB.pm ↑ Summary Config/UI.pm »
1 package User::Config::DB::Mem;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 with 'User::Config::DB';
8  
9 1 our $VERSION = '0.01_00';
10 1 $VERSION = eval $VERSION; # see L<perlmodstyle>
11  
12 =pod
13  
14 =head1 NAME
15  
16 User::Config::DB::Mem - Storing the user-configuration in memory, only.
17  
18 =head1 DESCRIPTION
19  
20 This is a database-backend for L<User::Config>. All options will be stored
21 in RAM and be lost after the nect restart of the application. But as it will run
22 without configuration, it is the default backend.
23  
24 =head2 METHODS
25  
26 =head3 C<isset()>, C<set()> and C<get()>
27  
28 See L<User::Config::DB>
29  
30 =head2 SEE ALSO
31  
32 =over 4
33  
34 =item L<User::Config::DB::Ldap>
35  
36 Stores the configuration data on an LDAP-Server
37  
38 =item L<User::Config::DB::Keyed>
39  
40 Stores the configuration data in an relational database-table
41  
42 =item L<User::Config::DB::DBIC>
43  
44 uses an DBIx::Class Schema to store the configuration-data.
45  
46 =back
47  
48 =cut
49  
50 0 ▶sub set {
Subroutine set: not called CC=1 SCAR=6.9
51 0 my ($self, $namespace, $user, $name, $ctx, $value) = @_;
52  
53 0 $self->{$namespace}->{$user}->{$name} = $value;
54 }
55  
56 0 ▶sub isset {
Subroutine isset: not called CC=3 SCAR=24.8
Pod documented
57 0 my ($self, $namespace, $user, $name, $ctx) = @_;
58 0 ▶ return unless $self->{$namespace};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{$namespace} 0 0 0
59 0 ▶ return unless $self->{$namespace}->{$user};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{$namespace}{$user} 0 0 0
60 0 return exists $self->{$namespace}->{$user}->{$name};
61 }
62  
63 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
64 0 my ($self, $namespace, $user, $name) = @_;
65 0 return $self->{$namespace}->{$user}->{$name};
66 }
67  
68 =head1 AUTHOR
69  
70 Benjamin Tietz E<lt>benjamin@micronet24.deE<gt>
71  
72 =head1 COPYRIGHT AND LICENSE
73  
74 Copyright (C) 2011 by Benjamin Tietz
75  
76 This library is free software; you can redistribute it and/or modify
77 it under the same terms as Perl itself, either Perl version 5.10.1 or,
78 at your option, any later version of Perl 5 you may have available.
79  
80 =cut
81  
82 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
83 1 __PACKAGE__->meta->make_immutable;
84 1 1;
85  
« Config/DB.pm ↑ Summary Config/UI.pm »