line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toolforge::MixNMatch::Object::YearMonth; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
446192
|
use strict; |
|
6
|
|
|
|
|
66
|
|
|
6
|
|
|
|
|
165
|
|
4
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
157
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
2820
|
use Mo qw(build is); |
|
6
|
|
|
|
|
2908
|
|
|
6
|
|
|
|
|
29
|
|
7
|
6
|
|
|
6
|
|
11697
|
use Mo::utils qw(check_required); |
|
6
|
|
|
|
|
73020
|
|
|
6
|
|
|
|
|
125
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 0.03; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has count => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
required => 1, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has month => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
required => 1, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has year => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
required => 1, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub BUILD { |
27
|
4
|
|
|
4
|
0
|
504
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
28
|
check_required($self, 'count'); |
30
|
4
|
|
|
|
|
50
|
check_required($self, 'month'); |
31
|
4
|
|
|
|
|
25
|
check_required($self, 'year'); |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
22
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=pod |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=encoding utf8 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Toolforge::MixNMatch::Object::YearMonth - Mix'n'match year/month datatype. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use Toolforge::MixNMatch::Object::YearMonth; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::YearMonth->new(%params); |
53
|
|
|
|
|
|
|
my $count = $obj->count; |
54
|
|
|
|
|
|
|
my $month = $obj->month; |
55
|
|
|
|
|
|
|
my $year = $obj->year; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This datatype is base class for Mix'n'match year/month. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 C<new> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::YearMonth->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<month> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Month of statistics. |
81
|
|
|
|
|
|
|
Parameter is required. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * C<year> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Year of statistics. |
86
|
|
|
|
|
|
|
Parameter is required. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 C<count> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my $count = $obj->count; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Get count for year/month statistics. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Returns number. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 C<month> |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
my $month = $obj->month; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Get month of statistics. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Returns number. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 C<year> |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
my $year = $obj->year; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Get year of statistics. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Returns number. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 ERRORS |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
new(): |
117
|
|
|
|
|
|
|
From Mo::utils::check_required(): |
118
|
|
|
|
|
|
|
Parameter 'count' is required. |
119
|
|
|
|
|
|
|
Parameter 'month' is required. |
120
|
|
|
|
|
|
|
Parameter 'year' is required. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 EXAMPLE |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
use strict; |
125
|
|
|
|
|
|
|
use warnings; |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
use Toolforge::MixNMatch::Object::YearMonth; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
# Object. |
130
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::YearMonth->new( |
131
|
|
|
|
|
|
|
'count' => 6, |
132
|
|
|
|
|
|
|
'month' => 1, |
133
|
|
|
|
|
|
|
'year' => 2020, |
134
|
|
|
|
|
|
|
); |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
# Get count for year/month statistics. |
137
|
|
|
|
|
|
|
my $count = $obj->count; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
# Get month of statistics. |
140
|
|
|
|
|
|
|
my $month = $obj->month; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
# Get year of statistics. |
143
|
|
|
|
|
|
|
my $year = $obj->year; |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# Print out. |
146
|
|
|
|
|
|
|
print "Count: $count\n"; |
147
|
|
|
|
|
|
|
print "Month: $month\n"; |
148
|
|
|
|
|
|
|
print "Year: $year\n"; |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# Output: |
151
|
|
|
|
|
|
|
# Count: 6 |
152
|
|
|
|
|
|
|
# Month: 1 |
153
|
|
|
|
|
|
|
# Year: 2020 |
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 |