line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toolforge::MixNMatch::Object::User; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
417389
|
use strict; |
|
6
|
|
|
|
|
55
|
|
|
6
|
|
|
|
|
285
|
|
4
|
6
|
|
|
6
|
|
30
|
use warnings; |
|
6
|
|
|
|
|
22
|
|
|
6
|
|
|
|
|
154
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
2398
|
use Mo qw(build is); |
|
6
|
|
|
|
|
2661
|
|
|
6
|
|
|
|
|
27
|
|
7
|
6
|
|
|
6
|
|
10272
|
use Mo::utils qw(check_required); |
|
6
|
|
|
|
|
57853
|
|
|
6
|
|
|
|
|
93
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 0.03; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has count => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
required => 1, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has uid => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
required => 1, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has username => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
required => 1, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub BUILD { |
27
|
7
|
|
|
7
|
0
|
17369
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
7
|
|
|
|
|
32
|
check_required($self, 'count'); |
30
|
6
|
|
|
|
|
61
|
check_required($self, 'uid'); |
31
|
5
|
|
|
|
|
32
|
check_required($self, 'username'); |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
19
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=pod |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=encoding utf8 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Toolforge::MixNMatch::Object::User - Mix'n'match user datatype. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use Toolforge::MixNMatch::Object::User; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::User->new(%params); |
53
|
|
|
|
|
|
|
my $count = $obj->count; |
54
|
|
|
|
|
|
|
my $uid = $obj->uid; |
55
|
|
|
|
|
|
|
my $username = $obj->username; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This datatype is base class for Mix'n'match user. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 C<new> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::User->new(%params); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Constructor. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Returns instance of object. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=over 8 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item * C<count> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Count number of records for user. |
76
|
|
|
|
|
|
|
Parameter is required. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * C<uid> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
User UID. |
81
|
|
|
|
|
|
|
Parameter is required. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * C<username> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
User name. |
86
|
|
|
|
|
|
|
Parameter is required. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 C<count> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my $count = $obj->count; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Get count for user. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Returns number. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 C<uid> |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
my $uid = $obj->uid; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Get UID of user. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Returns number. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 C<username> |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
my $username = $obj->username; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Get user name. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Returns string. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 ERRORS |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
new(): |
117
|
|
|
|
|
|
|
From Mo::utils::check_required(): |
118
|
|
|
|
|
|
|
Parameter 'count' is required. |
119
|
|
|
|
|
|
|
Parameter 'uid' is required. |
120
|
|
|
|
|
|
|
Parameter 'username' is required. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 EXAMPLE |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
use strict; |
125
|
|
|
|
|
|
|
use warnings; |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
use Toolforge::MixNMatch::Object::User; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
# Object. |
130
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::User->new( |
131
|
|
|
|
|
|
|
'count' => 6, |
132
|
|
|
|
|
|
|
'uid' => 1, |
133
|
|
|
|
|
|
|
'username' => 'Skim', |
134
|
|
|
|
|
|
|
); |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
# Get count for user. |
137
|
|
|
|
|
|
|
my $count = $obj->count; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
# Get UID of user. |
140
|
|
|
|
|
|
|
my $uid = $obj->uid; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
# Get user name. |
143
|
|
|
|
|
|
|
my $username = $obj->username; |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# Print out. |
146
|
|
|
|
|
|
|
print "Count: $count\n"; |
147
|
|
|
|
|
|
|
print "UID: $uid\n"; |
148
|
|
|
|
|
|
|
print "User name: $username\n"; |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# Output: |
151
|
|
|
|
|
|
|
# Count: 6 |
152
|
|
|
|
|
|
|
# UID: 1 |
153
|
|
|
|
|
|
|
# User name: Skim |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
L<Mo>, |
158
|
|
|
|
|
|
|
L<Mo::utils>. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 SEE ALSO |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=over |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item L<Toolforge::MixNMatch::Object> |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Toolforge Mix'n'match tool objects. |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=back |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head1 REPOSITORY |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
L<https://github.com/michal-josef-spacek/Toolforge-MixNMatch-Object> |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=head1 AUTHOR |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
Michal Josef Špaček L<mailto:skim@cpan.org> |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
L<http://skim.cz> |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
© Michal Josef Špaček 2020 |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
BSD 2-Clause License |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head1 VERSION |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
0.03 |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=cut |