lib/Rex/Shared/Var/Scalar.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 100% 31 / 31 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Rex/Args/String.pm ↑ Summary
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Shared::Var::Scalar;
6  
7 14 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 14 ▶use Rex::Shared::Var::Common qw/__lock __store __retrieve/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 14 our $VERSION = '1.16.1'; # VERSION
13  
14 55 ▶sub TIESCALAR {
Subroutine TIESCALAR: called CC=1 SCAR=0.0
15 55 my $self = { varname => $_[1], };
16 55 bless $self, $_[0];
17 }
18  
19 85 ▶sub STORE {
Subroutine STORE: called CC=1 SCAR=0.0
20 85 my $self = shift;
21 85 my $value = shift;
22  
23 85 ▶ return __lock sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
24 85 my $ref = __retrieve;
25 85 my $ret = $ref->{ $self->{varname} } = $value;
26 85 __store $ref;
27  
28 85 return $ret;
29 85 };
30 }
31  
32 103 ▶sub FETCH {
Subroutine FETCH: called CC=1 SCAR=0.0
33 103 my $self = shift;
34  
35 103 ▶ return __lock sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
36 103 my $ref = __retrieve;
37 103 return $ref->{ $self->{varname} };
38 103 };
39 }
40  
41 14 1;
« blib/lib/Rex/Args/String.pm ↑ Summary