Uaf/User.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 37 CC 2 SCAR 11.5
CC
2
Cov
0%
attribute
6.0
new
2.0
username
2.0
CRAP 3.1
1 package Gantry::Plugins::Uaf::User;
2  
3 use 5.008;
4 use strict;
5 use warnings;
6  
7 our $VERSION = '0.01';
8  
9 sub new {
10 my ($proto, $username) = @_;
11  
12 my $class = ref($proto) || $proto;
13 my $self = {
14 username => $username,
15 attributes => {}
16 };
17  
18 bless($self, $class);
19  
20 return $self;
21  
22 }
23  
24 sub username {
25 my ($self) = shift;
26  
27 return $self->{username};
28  
29 }
30  
31 sub attribute {
32 my ($self, $name, $p) = @_;
33  
34 $self->{attributes}->{$name} = $p if (defined($p));
35 return $self->{attributes}->{$name};
36  
37 }
38  
39 1;
40  
41 __END__