blib/lib/XML/NewsML_G2/Media_Topic.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.0
« blib/lib/XML/NewsML_G2/Location.pm ↑ Summary blib/lib/XML/NewsML_G2/Organisation.pm »
1 package XML::NewsML_G2::Media_Topic;
2  
3 # $Id: Media_Topic.pm 46519 2013-05-31 15:38:08Z apatecgortan $
4  
5 10 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 10 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 10 has 'name', isa => 'Str', is => 'ro', required => 1;
10 10 has 'qcode', isa => 'Str', is => 'ro', required => 1;
11 15 ▶has 'translations', isa => 'HashRef', is => 'rw', default => sub { {} }, traits => ['Hash'],
Subroutine __ANON__: called CC=1 SCAR=0.0
12 handles => {add_translation => 'set'};
13 10 has 'parent', isa => __PACKAGE__, is => 'rw';
14 10 has 'direct', isa => 'Bool', is => 'rw', default => '';
15  
16 10 __PACKAGE__->meta->make_immutable;
17  
18 10 1;
19 __END__
20  
21 =head1 NAME
22  
23 XML::NewsML_G2::Media_Topic - a subject covered in the news item,
24 taken from a standardized controlled vocabulary
25  
26 =head1 SYNOPSIS
27  
28 my $mm = XML::NewsML_G2::Media_Topic->new
29 (name => 'mass media', qcode => 20000045);
30 my $tv = XML::NewsML_G2::Media_Topic->new
31 (name => 'television', qcode => 20000051, parent => $mm);
32 $tv->add_translation(de => 'Fernsehen')
33  
34 =head1 ATTRIBUTES
35  
36 =over 4
37  
38 =item name
39  
40 =item qcode
41  
42 =item translations
43  
44 hash mapping IANA language codes to the translation of the name in that language
45  
46 =item parent
47  
48 points to the broader media topic
49  
50 =item direct
51  
52 whether the media topic has been manually specified by the editor
53  
54 =back
55  
56 =head1 METHODS
57  
58 =over 4
59  
60 =item add_translation
61  
62 =back
63  
64 =head1 AUTHOR
65  
66 Philipp Gortan C<< <philipp.gortan@apa.at> >>
67  
68 =head1 LICENCE AND COPYRIGHT
69  
70 Copyright (c) 2013, APA-IT. All rights reserved.
71  
72 See L<XML::NewsML_G2> for the license.
« blib/lib/XML/NewsML_G2/Location.pm ↑ Summary blib/lib/XML/NewsML_G2/Organisation.pm »