TimeZone/Object.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 3 / 3 totaltotal 100% 35 / 35 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« TimeZone/List.pm ↑ Summary TimeZone/Object/Africa/Abidjan.pm »
1 =head1 NAME
2  
3 Data::ICal::TimeZone::Object - base class for Data::ICal::TimeZone timezone objects
4  
5 =head1 METHODS
6  
7 =over
8  
9 =item timezone
10  
11 Returns the timezone identifier for the current zone object
12  
13 =item definition
14  
15 Returns a Data::ICal::Entry::TimeZone which defines the given zone.
16  
17 =back
18  
19 =HEAD1 SEE ALSO
20  
21 L<Data::ICal::TimeZone>
22  
23 =cut
24  
25 package Data::ICal::TimeZone::Object;
26 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use base qw( Class::Singleton Class::Accessor );
Subroutine BEGIN: called CC=1 SCAR=0.0
28 2 __PACKAGE__->mk_accessors(qw( _cal ));
29 2 ▶use Data::ICal;
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 800 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
32 800 my $self = shift;
33 800 return $self->instance;
34 }
35  
36 401 ▶sub definition {
Subroutine definition: called CC=1 SCAR=0.0
Pod documented
37 401 my $self = shift;
38 my @zones = grep {
39 401 $_->ical_entry_type eq 'VTIMEZONE'
40 401 } @{ $self->_cal->entries };
41 401 return $zones[0];
42 }
43  
44 400 ▶sub timezone {
Subroutine timezone: called CC=1 SCAR=0.0
Pod documented
45 400 my $self = shift;
46 400 return $self->definition->property('tzid')->[0]->value;
47 }
48  
49 400 ▶sub _load {
Subroutine _load: called CC=1 SCAR=0.0
50 400 my $self = shift;
51 400 my $ics = shift;
52 400 my $cal = Data::ICal->new( data => $ics );
53 400 $self->_cal( $cal );
54 400 return;
55 }
56  
57 2 1;
« TimeZone/List.pm ↑ Summary TimeZone/Object/Africa/Abidjan.pm »