File Coverage

blib/lib/Data/ICal/Entry/Alarm.pm
Criterion Covered Total %
statement 16 16 100.0
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 4 4 100.0
total 28 29 96.5


line stmt bran cond sub pod time code
1 2     2   8 use warnings;
  2         2  
  2         58  
2 2     2   6 use strict;
  2         2  
  2         55  
3              
4             package Data::ICal::Entry::Alarm;
5              
6 2     2   7 use base qw/Data::ICal::Entry/;
  2         2  
  2         330  
7              
8             =head1 NAME
9              
10             Data::ICal::Entry::Alarm - Abstract base class for alarms
11              
12             =head1 DESCRIPTION
13              
14             L is an abstract base class for the other type
15             of supported by alarms:
16              
17             =over
18              
19             =item L
20              
21             =item L
22              
23             =item L
24              
25             =item L
26              
27             =back
28              
29             It is a subclass of L and accepts all of its methods.
30              
31             =head1 METHODS
32              
33             =cut
34              
35             =head2 new
36              
37              
38             =cut
39              
40             sub new {
41 5     5 1 4 my $class = shift;
42 5         17 my $self = $class->SUPER::new(@_);
43 5 50       12 die "Can't instantiate abstract base class Data::ICal::Entry::Alarm"
44             if $class eq __PACKAGE__;
45 5         8 return $self;
46             }
47              
48             =head2 ical_entry_type
49              
50             Returns C, its iCalendar entry name.
51              
52             =cut
53              
54 4     4 1 13 sub ical_entry_type {'VALARM'}
55              
56             =head2 optional_unique_properties
57              
58             According to the iCalendar standard, the C and C
59             properties may be specified at most one time all types of alarms; if one
60             is specified, the other one must be also, though this module does not
61             enforce that restriction.
62              
63             =cut
64              
65             sub optional_unique_properties {
66 60     60 1 107 qw(
67             duration repeat
68             );
69             }
70              
71             =head2 mandatory_unique_properties
72              
73             According to the iCalendar standard, the C property must be
74             specified exactly once for an all types of alarms; subclasses may have
75             additional required properties.
76              
77             In addition, the C property must be specified exactly once, but
78             all subclasses automatically set said property appropriately.
79              
80             =cut
81              
82             sub mandatory_unique_properties {
83 62     62 1 120 qw(
84             action trigger
85             );
86             }
87              
88             =head1 AUTHOR
89              
90             Best Practical Solutions, LLC Emodules@bestpractical.comE
91              
92             =head1 LICENCE AND COPYRIGHT
93              
94             Copyright (c) 2005 - 2015, Best Practical Solutions, LLC. All rights reserved.
95              
96             This module is free software; you can redistribute it and/or
97             modify it under the same terms as Perl itself. See L.
98              
99             =cut
100              
101             1;