blib/lib/QWizard/Storage/Memory.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 6 totaltotal 84.6% 33 / 39 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
new
1.0
CRAP 1.0
« blib/lib/QWizard/Storage/CGIParam.pm ↑ Summary Storage/t/file.t »
1 package QWizard::Storage::Memory;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use QWizard::Storage::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 our @ISA = qw(QWizard::Storage::Base);
7  
8 3 our $VERSION = '3.15';
9  
10 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11 3 my $class = shift;
12 3 bless {}, $class;
13 }
14  
15 17 ▶sub get_all {
Subroutine get_all: called CC=1 SCAR=0.0
Pod undocumented
16 17 my $self = shift;
17 17 return $self->{'vars'};
18 }
19  
20 14 ▶sub set {
Subroutine set: called CC=1 SCAR=0.0
Pod undocumented
21 14 my ($self, $it, $value) = @_;
22 14 $self->{'vars'}{$it} = $value;
23 14 return $value;
24 }
25  
26 # faster than the parent iterative method
27 4 ▶sub set_all {
Subroutine set_all: called CC=1 SCAR=0.0
Pod undocumented
28 4 my $self = shift;
29 4 %{$self->{'vars'}} = %{$_[0]};
30 }
31  
32 13 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod undocumented
33 13 my ($self, $it, $value) = @_;
34 13 return $self->{'vars'}{$it};
35 }
36  
37 7 ▶sub reset {
Subroutine reset: called CC=1 SCAR=0.0
Pod undocumented
38 7 my $self = shift;
39 7 %{$self->{'vars'}} = ();
40 }
41  
42 3 1;
43  
44 =pod
45  
46 =head1 NAME
47  
48 QWizard::Storage::Memory - Stores data in CGI variables
49  
50 =head1 SYNOPSIS
51  
52 my $st = new QWizard::Storage::Memory();
53 $st->set('var', 'value');
54 $st->get('var');
55  
56 =head1 DESCRIPTION
57  
58 Stores data passed to it inside of CGI parameters.
59  
60 =head1 AUTHOR
61  
62 Wes Hardaker, hardaker@users.sourceforge.net
63  
64 =head1 SEE ALSO
65  
66 perl(1)
67  
68 Net-Policy: http://net-policy.sourceforge.net/
69  
70 =cut
« blib/lib/QWizard/Storage/CGIParam.pm ↑ Summary Storage/t/file.t »