File Coverage

blib/lib/Enum/Declare/Common/Calendar.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Enum::Declare::Common::Calendar;
2              
3 2     2   85450 use 5.014;
  2         6  
4 2     2   7 use strict;
  2         2  
  2         46  
5 2     2   5 use warnings;
  2         4  
  2         1636  
6              
7 2     2   444 use Enum::Declare;
  2         10507  
  2         559  
8              
9             # ── Weekday (ISO 8601: Monday=1 .. Sunday=7) ──
10              
11             enum Weekday :Type :Export {
12             Monday = 1,
13             Tuesday = 2,
14             Wednesday = 3,
15             Thursday = 4,
16             Friday = 5,
17             Saturday = 6,
18             Sunday = 7
19             };
20              
21             # ── WeekdayFlag (bitmask for scheduling) ──
22              
23             enum WeekdayFlag :Flags :Type :Export {
24             Mon,
25             Tue,
26             Wed,
27             Thu,
28             Fri,
29             Sat,
30             Sun
31             };
32              
33             # ── Month (January=1 .. December=12) ──
34              
35             enum Month :Type :Export {
36             January = 1,
37             February = 2,
38             March = 3,
39             April = 4,
40             May = 5,
41             June = 6,
42             July = 7,
43             August = 8,
44             September = 9,
45             October = 10,
46             November = 11,
47             December = 12
48             };
49              
50             1;
51              
52             =head1 NAME
53              
54             Enum::Declare::Common::Calendar - Weekday, weekday flags, and month enums
55              
56             =head1 SYNOPSIS
57              
58             use Enum::Declare::Common::Calendar;
59              
60             say Monday; # 1
61             say January; # 1
62             say December; # 12
63              
64             # Bitmask scheduling
65             my $weekdays = Mon | Tue | Wed | Thu | Fri; # 31
66             ok($weekdays & Mon); # true
67              
68             =head1 ENUMS
69              
70             =head2 Weekday :Export
71              
72             ISO 8601 weekdays: Monday=1 through Sunday=7.
73              
74             =head2 WeekdayFlag :Flags :Export
75              
76             Bitmask flags: Mon=1, Tue=2, Wed=4, Thu=8, Fri=16, Sat=32, Sun=64.
77              
78             =head2 Month :Export
79              
80             Months: January=1 through December=12.
81              
82             =head1 AUTHOR
83              
84             LNATION C<< >>
85              
86             =head1 LICENSE AND COPYRIGHT
87              
88             Copyright 2026 LNATION. Artistic License 2.0.
89              
90             =cut