| 1 | package XML::ASX::Event; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use vars qw($VERSION $AUTOLOAD @ISA); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | @ISA = qw(XML::ASX); | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use XML::ASX::Entry; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use overload '""' => \&xml; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | $VERSION = '0.01'; | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | my %RW_SLOTS = ( | |||||||||||||||||||||||||||||||||||||||||
| 15 | name => '', | ||||||||||||||||||||||||||||||||||||||||||
| 16 | whendone => '', | ||||||||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 5 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 5 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 5 | my $param = $AUTOLOAD; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 5 | $param =~ s/.*:://; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 5 | ▶ | die(__PACKAGE__." doesn't implement $param") unless defined($RW_SLOTS{$param}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 4 | ▶ | $self->{$param} = shift if @_; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 4 | return $self->{$param}; | |||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | my %param = @_; | |||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | my $self = bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | $self->$_($RW_SLOTS{$_}) foreach keys %RW_SLOTS; | |||||||||||||||||||||||||||||||||||||||||
| 34 | 1 | $self->$_($param{$_}) foreach keys %param; | |||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | 1 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | sub add_entry { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_entry: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | my $entry = XML::ASX::Entry->new; | |||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | push @{$self->{queue}}, $entry; | |||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | return $self->{queue}->[scalar @{$self->{queue}} - 1]; | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | sub xml { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
xml: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | die __PACKAGE__.': name() required' unless $self->name; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | die __PACKAGE__.': whendone() required. Valid values are "RESUME","NEXT","BREAK"' unless $self->whendone eq 'RESUME' or $self->whendone eq 'NEXT' or $self->whendone eq 'BREAK'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$self->whendone eq "RESUME" or $self->whendone eq "NEXT" or $self->whendone eq "BREAK"
$self->whendone eq "RESUME" or $self->whendone eq "NEXT"
MC/DC0%0/3
$self->whendone eq "RESUME" or $self->whendone eq "NEXT" or $self->whendone eq "BREAK"
$self->whendone eq "RESUME"
$self->whendone eq "NEXT"
$self->whendone eq "BREAK"
Truth table0%0/4
A or B or C
A= $self->whendone eq "RESUME"B= $self->whendone eq "NEXT"C= $self->whendone eq "BREAK"
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | my $content = join '', ($self->each_in_queue); | |||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | return $self->entag('Event',$content,{NAME=>$self->name,WHENDONE=>$self->whendone}); | |||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 59 | __END__ | ||||||||||||||||||||||||||||||||||||||||||