| 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__ | ||