| 1 | package XML::ASX::Repeat; | ||||||||||||||||||||
| 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 | count => '1', | ||||||||||||||||||||
| 16 | ); | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 3 | ▶ | sub AUTOLOAD { | ||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 19 | 3 | my $self = shift; | |||||||||||||||||||
| 20 | 3 | my $param = $AUTOLOAD; | |||||||||||||||||||
| 21 | 3 | $param =~ s/.*:://; | |||||||||||||||||||
| 22 | 3 | ▶ | die(__PACKAGE__." doesn't implement $param") unless defined($RW_SLOTS{$param}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 23 | 2 | ▶ | $self->{$param} = shift if @_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 24 | 2 | return $self->{$param}; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||
| 28 | 1 | my $class = shift; | |||||||||||||||||||
| 29 | 1 | my %param = @_; | |||||||||||||||||||
| 30 | 1 | my $self = bless {}, $class; | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 1 | $self->$_($RW_SLOTS{$_}) foreach keys %RW_SLOTS; | |||||||||||||||||||
| 33 | 1 | $self->$_($param{$_}) foreach keys %param; | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 1 | return $self; | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 2 | ▶ | sub add_entry { | ||||||||||||||||||
|
Subroutine
add_entry: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 39 | 2 | my $self = shift; | |||||||||||||||||||
| 40 | 2 | ▶ | my $entry = shift || XML::ASX::Entry->new; | ||||||||||||||||||
|
Condition66%2/3
shift() || 'XML::ASX::Entry'->new
MC/DC0%0/2
shift() || 'XML::ASX::Entry'->new
shift()
'XML::ASX::Entry'->new
Truth table66%2/3
A || B
A= shift()B= 'XML::ASX::Entry'->new
| |||||||||||||||||||||
| 41 | 2 | push @{$self->{entries}}, $entry; | |||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 2 | return $self->{entries}->[scalar @{$self->{entries}} - 1]; | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 0 | ▶ | sub each_entry { | ||||||||||||||||||
|
Subroutine
each_entry: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 47 | 0 | my $self = shift; | |||||||||||||||||||
| 48 | 0 | ▶ | return $self->{entries} ? @{$self->{entries}} : (); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 0 | ▶ | sub xml { | ||||||||||||||||||
|
Subroutine
xml: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 52 | 0 | my $self = shift; | |||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | my $content = join '', ($self->each_entry); | |||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 0 | return $self->entag('Repeat',$content,{COUNT=>$self->count}); | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 1 | 1; | |||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||