File Coverage

blib/lib/XML/NewsML_G2/Event_Item.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package XML::NewsML_G2::Event_Item;
2              
3 18     18   120 use Moose;
  18         41  
  18         112  
4 18     18   109495 use namespace::autoclean;
  18         42  
  18         128  
5              
6             extends 'XML::NewsML_G2::Concept_Item';
7              
8             has '+title', isa => 'XML::NewsML_G2::Translatable_Text', coerce => 1;
9             has '+subtitle', isa => 'XML::NewsML_G2::Translatable_Text', coerce => 1;
10             has '+summary', isa => 'XML::NewsML_G2::Translatable_Text', coerce => 1;
11              
12             has 'event_id', is => 'ro', isa => 'Str', required => 1;
13             has 'location', is => 'ro', isa => 'XML::NewsML_G2::Location', required => 1;
14             has 'start', is => 'ro', isa => 'DateTime', required => 1;
15             has 'end', is => 'ro', isa => 'DateTime', required => 1;
16             has 'coverages',
17             is => 'ro',
18             isa => 'ArrayRef[Str]',
19             default => sub { [] },
20             traits => [qw/Array/],
21             handles => {
22             add_coverage => 'push',
23             has_coverage => 'count',
24             all_coverage => 'elements'
25             };
26              
27             __PACKAGE__->meta->make_immutable;
28              
29             1;
30             __END__
31              
32             =head1 NAME
33              
34             XML::NewsML_G2::Event_Item - an event as concept item
35              
36             =head1 SYNOPSIS
37              
38             my $event = XML::NewsML_G2::Event_Item->new();
39              
40             =head1 DESCRIPTION
41              
42             An event item is an event as described in
43             https://iptc.org/std/NewsML-G2/guidelines/#events-in-newsml-g2
44             that can be published standalone
45              
46             =head1 ATTRIBUTES
47              
48             =over 4
49              
50             =item coverages
51              
52             Freetext list of intented coverages (e.g. 'Text', 'Photo', ...)
53              
54             =item end
55              
56             The end date and time of the event
57              
58             =item event_id
59              
60             The unique id of the event
61              
62             =item language
63              
64             language of the event, required. E.g. "en", "de", ...
65              
66             =item location
67              
68             The location of the event
69              
70             =item start
71              
72             The start date and time of the event
73              
74             =item subtitle
75              
76             A short description of the event
77              
78             =item summary
79              
80             A more detailed description of the event
81              
82             =item title
83              
84             The title of the referenced event
85              
86             =item media_topics
87              
88             Hash mapping qcodes to L<XML::NewsML_G2::Media_Topic> instances
89              
90             =item concepts
91              
92             Hash mapping generated uids to L<XML::NewsML_G2::Concept> instances
93              
94             =back
95              
96             =head1 METHODS
97              
98             =over 4
99              
100             =item add_media_topic
101              
102             Add a new L<XML::NewsML_G2::MediaTopic> instance
103              
104             =item add_concept
105              
106             Add a new L<XML::NewsML_G2::Concept> instance
107              
108             =back
109              
110             =head1 AUTHOR
111              
112             Christian Eder C<< <christian.eder@apa.at> >>
113              
114             =head1 LICENCE AND COPYRIGHT
115              
116             Copyright (c) 2019, APA-IT. All rights reserved.
117              
118             See L<XML::NewsML_G2> for the license.