| 1 | package Net::Google::Calendar::Calendar; | ||||||||||||
| 2 | { | ||||||||||||
| 3 | 6 | $Net::Google::Calendar::Calendar::VERSION = '1.05'; | |||||||||||
| 4 | } | ||||||||||||
| 5 | |||||||||||||
| 6 | 6 | ▶ | use base qw(Net::Google::Calendar::Entry); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | =head1 NAME | ||||||||||||
| 9 | |||||||||||||
| 10 | Net::Google::Calendar::Calendar - entry class for Net::Google::Calendar Calendar objects | ||||||||||||
| 11 | |||||||||||||
| 12 | =head1 METHODS | ||||||||||||
| 13 | |||||||||||||
| 14 | Note this is very rough at the moment - there are plenty of | ||||||||||||
| 15 | convenience methods that could be added but for now you'll | ||||||||||||
| 16 | have to access them using the underlying C<XML::Atom::Entry> | ||||||||||||
| 17 | object. | ||||||||||||
| 18 | |||||||||||||
| 19 | =head2 new | ||||||||||||
| 20 | |||||||||||||
| 21 | =cut | ||||||||||||
| 22 | |||||||||||||
| 23 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 24 | 0 | my ($class, %opts) = @_; | |||||||||||
| 25 | |||||||||||||
| 26 | 0 | my $self = $class->SUPER::new( Version => '1.0', %opts ); | |||||||||||
| 27 | 0 | $self->_initialize(); | |||||||||||
| 28 | 0 | return $self; | |||||||||||
| 29 | } | ||||||||||||
| 30 | |||||||||||||
| 31 | 0 | ▶ | sub _initialize { | ||||||||||
|
Subroutine
_initialize: not called CC=1 SCAR=6.9
| |||||||||||||
| 32 | 0 | my $self = shift; | |||||||||||
| 33 | |||||||||||||
| 34 | 0 | $self->{_gd_ns} = XML::Atom::Namespace->new(gd => 'http://schemas.google.com/g/2005'); | |||||||||||
| 35 | 0 | $self->{_gcal_ns} = XML::Atom::Namespace->new(gCal => 'http://schemas.google.com/gCal/2005'); | |||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | =head2 summary [value] | ||||||||||||
| 39 | |||||||||||||
| 40 | A summary of the calendar. | ||||||||||||
| 41 | |||||||||||||
| 42 | =cut | ||||||||||||
| 43 | |||||||||||||
| 44 | 0 | ▶ | sub summary { | ||||||||||
|
Subroutine
summary: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 45 | 0 | my $self= shift; | |||||||||||
| 46 | 0 | ▶ | if (@_) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 47 | 0 | $self->set($self->ns, 'summary', shift); | |||||||||||
| 48 | } | ||||||||||||
| 49 | 0 | return $self->get($self->ns, 'summary'); | |||||||||||
| 50 | } | ||||||||||||
| 51 | |||||||||||||
| 52 | |||||||||||||
| 53 | =head2 edit_url | ||||||||||||
| 54 | |||||||||||||
| 55 | Get the edit url | ||||||||||||
| 56 | |||||||||||||
| 57 | =cut | ||||||||||||
| 58 | |||||||||||||
| 59 | 0 | ▶ | sub edit_url { | ||||||||||
|
Subroutine
edit_url: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 60 | 0 | my $self = shift; | |||||||||||
| 61 | 0 | ▶ | my $force = shift || 0; | ||||||||||
|
Condition0%0/2
shift() || 0
MC/DC0%0/1
shift() || 0
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 62 | 0 | my $url = $self->_generic_url('edit'); | |||||||||||
| 63 | |||||||||||||
| 64 | 0 | ▶ | $url =~ s!/allcalendars/full!/owncalendars/full! if $force; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 65 | 0 | return $url; | |||||||||||
| 66 | } | ||||||||||||
| 67 | |||||||||||||
| 68 | =head2 color | ||||||||||||
| 69 | |||||||||||||
| 70 | The color assigned to the calendar. | ||||||||||||
| 71 | |||||||||||||
| 72 | =cut | ||||||||||||
| 73 | |||||||||||||
| 74 | 0 | ▶ | sub color { | ||||||||||
|
Subroutine
color: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 75 | 0 | my $self = shift; | |||||||||||
| 76 | 0 | ▶ | if (@_) {} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 77 | 0 | ▶ | if (my $el = $self->elem->getChildrenByTagName('gCal:color')->[0]) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 78 | 0 | return $el->getAttribute('value'); | |||||||||||
| 79 | } | ||||||||||||
| 80 | 0 | return; | |||||||||||
| 81 | } | ||||||||||||
| 82 | |||||||||||||
| 83 | =head2 override_name | ||||||||||||
| 84 | |||||||||||||
| 85 | Returns the override name of the calendar. Not always set. | ||||||||||||
| 86 | |||||||||||||
| 87 | =cut | ||||||||||||
| 88 | |||||||||||||
| 89 | 0 | ▶ | sub override_name { | ||||||||||
|
Subroutine
override_name: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 90 | 0 | my $self = shift; | |||||||||||
| 91 | 0 | ▶ | if (@_) {} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 92 | 0 | ▶ | if (my $el = $self->elem->getChildrenByTagName('gCal:overridename')->[0]) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 93 | 0 | return $el->getAttribute('value'); | |||||||||||
| 94 | } | ||||||||||||
| 95 | 0 | return; | |||||||||||
| 96 | } | ||||||||||||
| 97 | |||||||||||||
| 98 | =head2 access_level | ||||||||||||
| 99 | |||||||||||||
| 100 | Returns the access level of the calendar. | ||||||||||||
| 101 | |||||||||||||
| 102 | =cut | ||||||||||||
| 103 | |||||||||||||
| 104 | 0 | ▶ | sub access_level { | ||||||||||
|
Subroutine
access_level: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 105 | 0 | my $self = shift; | |||||||||||
| 106 | 0 | ▶ | if (@_) {} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 107 | 0 | ▶ | if (my $el = $self->elem->getChildrenByTagName('gCal:accesslevel')->[0]) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 108 | 0 | return $el->getAttribute('value'); | |||||||||||
| 109 | } | ||||||||||||
| 110 | 0 | return; | |||||||||||
| 111 | } | ||||||||||||
| 112 | |||||||||||||
| 113 | =head2 hidden | ||||||||||||
| 114 | |||||||||||||
| 115 | Returns true if the calendar is hidden, false otherwise | ||||||||||||
| 116 | |||||||||||||
| 117 | =cut | ||||||||||||
| 118 | |||||||||||||
| 119 | 0 | ▶ | sub hidden { | ||||||||||
|
Subroutine
hidden: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 120 | 0 | my $self = shift; | |||||||||||
| 121 | 0 | ▶ | if (@_) {} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 122 | 0 | ▶ | if (my $el = $self->elem->getChildrenByTagName('gCal:hidden')->[0]) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 123 | 0 | ▶ | if ($el->getAttribute('value') eq 'true') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 124 | 0 | return 1; | |||||||||||
| 125 | } | ||||||||||||
| 126 | } | ||||||||||||
| 127 | 0 | return 0; | |||||||||||
| 128 | } | ||||||||||||
| 129 | |||||||||||||
| 130 | |||||||||||||
| 131 | =head2 selected | ||||||||||||
| 132 | |||||||||||||
| 133 | Returns true if the calendar is selected, false otherwise. | ||||||||||||
| 134 | |||||||||||||
| 135 | =cut | ||||||||||||
| 136 | |||||||||||||
| 137 | 0 | ▶ | sub selected { | ||||||||||
|
Subroutine
selected: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 138 | 0 | my $self = shift; | |||||||||||
| 139 | 0 | ▶ | if (@_) {} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 140 | 0 | ▶ | if (my $el = $self->elem->getChildrenByTagName('gCal:selected')->[0]) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 141 | 0 | ▶ | if ($el->getAttribute('value') eq 'true') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 142 | 0 | return 1; | |||||||||||
| 143 | } | ||||||||||||
| 144 | } | ||||||||||||
| 145 | 0 | return 0; | |||||||||||
| 146 | } | ||||||||||||
| 147 | |||||||||||||
| 148 | =head2 time_zone | ||||||||||||
| 149 | |||||||||||||
| 150 | Returns the time zone of the calendar. | ||||||||||||
| 151 | |||||||||||||
| 152 | =cut | ||||||||||||
| 153 | |||||||||||||
| 154 | 0 | ▶ | sub time_zone { | ||||||||||
|
Subroutine
time_zone: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 155 | 0 | my $self = shift; | |||||||||||
| 156 | 0 | ▶ | if (@_) {} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 157 | 0 | ▶ | if (my $el = $self->elem->getChildrenByTagName('gCal:timezone')->[0]) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 158 | 0 | return $el->getAttribute('value'); | |||||||||||
| 159 | } | ||||||||||||
| 160 | 0 | return; | |||||||||||
| 161 | } | ||||||||||||
| 162 | |||||||||||||
| 163 | |||||||||||||
| 164 | |||||||||||||
| 165 | =head2 times_cleaned | ||||||||||||
| 166 | |||||||||||||
| 167 | Returns the value of timesCleaned | ||||||||||||
| 168 | |||||||||||||
| 169 | =cut | ||||||||||||
| 170 | |||||||||||||
| 171 | 0 | ▶ | sub times_cleaned { | ||||||||||
|
Subroutine
times_cleaned: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 172 | 0 | my $self = shift; | |||||||||||
| 173 | 0 | ▶ | if (@_) {} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 174 | 0 | ▶ | if (my $el = $self->elem->getChildrenByTagName('gCal:timesCleaned')->[0]) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 175 | 0 | return $el->getAttribute('value'); | |||||||||||
| 176 | } | ||||||||||||
| 177 | 0 | return; | |||||||||||
| 178 | } | ||||||||||||
| 179 | |||||||||||||
| 180 | 6 | 1; | |||||||||||