| 1 | package Net::Google::Calendar::Base; | ||||||||||
| 2 | { | ||||||||||
| 3 | 6 | $Net::Google::Calendar::Base::VERSION = '1.05'; | |||||||||
| 4 | } | ||||||||||
| 5 | |||||||||||
| 6 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 6 | ▶ | use XML::Atom::Thing; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 6 | ▶ | use XML::Atom::Util qw( set_ns first nodelist childlist iso2dt); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | Net::Google::Calendar::Base - utility functions for Net::Google::Calendar objects | ||||||||||
| 13 | |||||||||||
| 14 | =cut | ||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub _initialize { | ||||||||
|
Subroutine
_initialize: not called CC=1 SCAR=6.9
| |||||||||||
| 18 | 0 | my $self = shift; | |||||||||
| 19 | 0 | my $ns = XML::Atom::Namespace->new(gd => 'http://schemas.google.com/g/2005'); | |||||||||
| 20 | 0 | $self->{_gd_ns} = $ns; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | # work round get in XML::Atom::Thing which stringifies stuff | ||||||||||
| 26 | 0 | ▶ | sub _my_get { | ||||||||
|
Subroutine
_my_get: not called CC=1 SCAR=6.9
| |||||||||||
| 27 | 0 | my $obj = shift; | |||||||||
| 28 | 0 | my($ns, $name) = @_; | |||||||||
| 29 | 0 | my @list = $obj->_my_getlist($ns, $name); | |||||||||
| 30 | 0 | return $list[0]; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub _my_getlist { | ||||||||
|
Subroutine
_my_getlist: not called CC=2 SCAR=17.9
| |||||||||||
| 34 | 0 | my $obj = shift; | |||||||||
| 35 | 0 | my($ns, $name) = @_; | |||||||||
| 36 | 0 | ▶ | my $ns_uri = ref($ns) eq 'XML::Atom::Namespace' ? $ns->{uri} : $ns; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | my @node = childlist($obj->elem, $ns_uri, $name); | |||||||||
| 38 | 0 | return @node; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub _generic_url { | ||||||||
|
Subroutine
_generic_url: not called CC=4 SCAR=30.0
| |||||||||||
| 42 | 0 | my $self = shift; | |||||||||
| 43 | 0 | my $name = shift; | |||||||||
| 44 | 0 | my $uri; | |||||||||
| 45 | 0 | for ($self->link) { | |||||||||
| 46 | 0 | ▶ | next unless $name eq $_->rel; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | 0 | $uri = $_; | |||||||||
| 48 | 0 | last; | |||||||||
| 49 | } | ||||||||||
| 50 | 0 | ▶ | return undef unless defined $uri; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | 0 | return $uri->href; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 6 | 1; | |||||||||