NewsML_G2/News_Message.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 21 / 21 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.0
« NewsML_G2/News_Item_Video.pm ↑ Summary NewsML_G2/Organisation.pm »
1 package XML::NewsML_G2::News_Message;
2  
3 20 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # header elements
7 20 has 'sent',
8 isa => 'DateTime',
9 is => 'ro',
10 lazy => 1,
11 builder => '_build_sent';
12  
13 has 'destination',
14 isa => 'ArrayRef[XML::NewsML_G2::Destination]',
15 is => 'ro',
16 2 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
17 20 traits => ['Array'],
18 handles => { add_destination => 'push' };
19  
20 #news/package items
21 has 'items',
22 isa => 'ArrayRef[XML::NewsML_G2::AnyItem]',
23 is => 'rw',
24 3 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
25 20 traits => ['Array'],
26 handles => { add_item => 'push' };
27  
28 20 has 'timezone', is => 'ro', isa => 'Str', default => 'local';
29  
30 3 ▶sub _build_sent {
Subroutine _build_sent: called CC=1 SCAR=0.0
31 3 my ($self) = @_;
32 3 return DateTime->now( time_zone => $self->timezone );
33 }
34  
35 20 __PACKAGE__->meta->make_immutable;
36  
37 20 1;
38 __END__
« NewsML_G2/News_Item_Video.pm ↑ Summary NewsML_G2/Organisation.pm »