blib/lib/XML/NewsML_G2/Role/Writer/News_Item_Audio.pm

filter: Statementstmt 70.0% 14 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 60.7% 17 / 28 CC 4 SCAR 24.7
CC
4
Cov
58%
__ANON__
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
« blib/lib/XML/NewsML_G2/Role/Writer/News_Item_Video.pm ↑ Summary blib/lib/XML/NewsML_G2/Writer/Package_Item.pm »
1 package XML::NewsML_G2::Role::Writer::News_Item_Audio;
2  
3 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 with 'XML::NewsML_G2::Role::Writer';
7  
8 around '_build_g2_catalog_schemes' => sub {
9 1 ▶ my ( $orig, $self, @args ) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
10 1 my $result = $self->$orig(@args);
11 1 $result->{rnd} = undef;
12 1 return $result;
13 2 };
14  
15 after '_create_remote_content' => sub {
16 0 ▶ my ( $self, $root, $audio ) = @_;
Subroutine __ANON__: not called CC=4 SCAR=30.0
17  
18 0 for (qw/size duration audiosamplerate/) {
19 0 ▶ $root->setAttribute( $_, $audio->$_ ) if defined $audio->$_;
Branch: 1 branch
BranchTrueFalseTotal
if defined $audio->$_ 0 0 0
20 }
21  
22 0 my $audiochannels =
23 $self->scheme_manager->build_qcode( 'adc', $audio->audiochannels );
24 0 ▶ $root->setAttribute( 'audiochannels', $audiochannels ) if $audiochannels;
Branch: 1 branch
BranchTrueFalseTotal
if $audiochannels 0 0 0
25 0 return;
26 2 };
27  
28 2 1;
29 __END__
30  
31 =head1 NAME
32  
33 XML::NewsML_G2::Role::Writer::News_Item_Audio - Role for writing news items of type 'audio'
34  
35 =head1 DESCRIPTION
36  
37 This module serves as a role for all NewsML-G2 writer classes and get automatically applied when the according news item type is written
38  
39 =head1 AUTHOR
40  
41 Mario Paumann C<< <mario.paumann@apa.at> >>
42  
43 =head1 LICENCE AND COPYRIGHT
44  
45 Copyright (c) 2014, APA-IT. All rights reserved.
46  
47 See L<XML::NewsML_G2> for the license.
« blib/lib/XML/NewsML_G2/Role/Writer/News_Item_Video.pm ↑ Summary blib/lib/XML/NewsML_G2/Writer/Package_Item.pm »