ICal/Entry/FreeBusy.pm

filter: Statementstmt 55.5% 10 / 18 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 100% 4 / 4 totaltotal 51.5% 17 / 33 CC 3 SCAR 12.4
CC
3
Cov
45%
mandatory_unique_properties
6.0
optional_unique_properties
6.0
ical_entry_type
2.0
CRAP 3.4
« ICal/Property.pm ↑ Summary ICal/Entry/Journal.pm »
1 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Data::ICal::Entry::FreeBusy;
5  
6 1 ▶use base qw/Data::ICal::Entry/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 Data::ICal::Entry::FreeBusy - Represents blocks of free and busy time in an iCalendar file
11  
12 =head1 SYNOPSIS
13  
14 my $vfreebusy = Data::ICal::Entry::FreeBusy->new();
15 $vfreebusy->add_properties(
16 organizer => 'MAILTO:jsmith@host.com',
17 # Dat*e*::ICal is not a typo here
18 freebusy => Date::ICal->new( epoch => ... )->ical . '/' . Date::ICal->new( epoch => ... )->ical,
19 );
20  
21 $calendar->add_entry($vfreebusy);
22  
23 =head1 DESCRIPTION
24  
25 A L<Data::ICal::Entry::FreeBusy> object represents a request for
26 information about free and busy time or a reponse to such a request,
27 in an iCalendar file. (Note that the iCalendar RFC refers to entries
28 as "components".) It is a subclass of L<Data::ICal::Entry> and
29 accepts all of its methods.
30  
31 =head1 METHODS
32  
33 =cut
34  
35 =head2 ical_entry_type
36  
37 Returns C<VFREEBUSY>, its iCalendar entry name.
38  
39 =cut
40  
41 0 ▶sub ical_entry_type {'VFREEBUSY'}
Subroutine ical_entry_type: not called CC=1 SCAR=6.9
Pod documented
42  
43 =head2 mandatory_unique_properties
44  
45 The C<uid> property is mandatory if C<rfc_strict> was passed to
46 L<Data::ICal/new>.
47  
48 =cut
49  
50 0 ▶sub mandatory_unique_properties {
Subroutine mandatory_unique_properties: not called CC=2 SCAR=17.9
Pod documented
51 0 my $self = shift;
52 0 ▶ return $self->rfc_strict ? ("uid") : ()
Branch: 1 branch
BranchTrueFalseTotal
$self->rfc_strict ? : 0 0 0
53 }
54  
55 =head2 optional_unique_properties
56  
57 According to the iCalendar standard, the following properties may be
58 specified at most one time for a free/busy entry:
59  
60 contact dtstart dtend duration dtstamp
61 organizer uid url
62  
63 =cut
64  
65 0 ▶sub optional_unique_properties {
Subroutine optional_unique_properties: not called CC=2 SCAR=17.9
Pod documented
66 0 my $self = shift;
67 0 my @ret = qw(
68 contact dtstart dtend duration dtstamp
69 organizer url
70 );
71 0 ▶ push @ret, "uid" unless $self->rfc_strict;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->rfc_strict 0 0 0
72 0 return @ret;
73 }
74  
75 =head2 optional_repeatable_properties
76  
77 According to the iCalendar standard, the following properties may be
78 specified any number of times for free/busy entry:
79  
80 attendee comment freebusy request-status
81  
82 =cut
83  
84 0 ▶sub optional_repeatable_properties {
Subroutine optional_repeatable_properties: not called CC=1 SCAR=6.9
Pod documented
85 0 qw(
86 attendee comment freebusy request-status
87 );
88 }
89  
90 =head1 AUTHOR
91  
92 Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt>
93  
94 =head1 LICENCE AND COPYRIGHT
95  
96 Copyright (c) 2005 - 2020, Best Practical Solutions, LLC. All rights reserved.
97  
98 This module is free software; you can redistribute it and/or
99 modify it under the same terms as Perl itself. See L<perlartistic>.
100  
101 =cut
102  
103 1 1;
« ICal/Property.pm ↑ Summary ICal/Entry/Journal.pm »