File Coverage

blib/lib/XML/NewsML_G2/Scheme.pm
Criterion Covered Total %
statement 9 9 100.0
branch 2 2 100.0
condition 3 3 100.0
subroutine 3 3 100.0
pod 0 1 0.0
total 17 18 94.4


line stmt bran cond sub pod time code
1             package XML::NewsML_G2::Scheme;
2              
3 18     18   125 use Moose;
  18         39  
  18         112  
4 18     18   111411 use namespace::autoclean;
  18         45  
  18         132  
5              
6             has 'alias', isa => 'Str', is => 'ro', required => 1;
7             has 'uri', isa => 'Str', is => 'ro';
8             has 'catalog', isa => 'Str', is => 'ro';
9              
10             sub BUILD {
11 345     345 0 520 my $self = shift;
12 345 100 100     8920 die "Either uri or catalog is required\n"
13             unless ( $self->uri or $self->catalog );
14 344         7877 return;
15             }
16              
17             __PACKAGE__->meta->make_immutable;
18              
19             1;
20             __END__
21              
22             =head1 NAME
23              
24             XML::NewsML_G2::Scheme - a Scheme (controlled vocabulary)
25              
26             =head1 SYNOPSIS
27              
28             my $genre = XML::NewsML_G2::Scheme->new
29             (alias => "genre",
30             uri => "http://cv.iptc.org/newscodes/genre/",
31             catalog => "http://www.iptc.org/std/catalog/catalog.IPTC-G2-Standards_22.xml");
32              
33             =head1 ATTRIBUTES
34              
35             =over 4
36              
37             =item alias
38              
39             The alias to be used for this scheme in the created output, required.
40              
41             =item uri
42              
43             String containing the URI of this scheme
44              
45             =item catalog
46              
47             Optional string containing the URI of the catalog containing this scheme
48              
49             =back
50              
51             =head1 AUTHOR
52              
53             Philipp Gortan C<< <philipp.gortan@apa.at> >>
54              
55             =head1 LICENCE AND COPYRIGHT
56              
57             Copyright (c) 2013-2014, APA-IT. All rights reserved.
58              
59             See L<XML::NewsML_G2> for the license.