blib/lib/WWW/NOS/Open/Broadcast.pm

filter: Statementstmt 100% 44 / 44 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 58 / 58 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/WWW/NOS/Open/AudioFragment.pm ↑ Summary blib/lib/WWW/NOS/Open/DayGuide.pm »
1 package WWW::NOS::Open::Broadcast v1.0.3; # -*- cperl; cperl-indent-level: 4 -*-
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 5 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use 5.014000;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶use Moose qw/around has with/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use Moose::Util::TypeConstraints qw/enum/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use namespace::autoclean '-also' => qr/^__/sxm;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 5 ▶use WWW::NOS::Open::TypeDef qw(NOSDateTime NOSURI);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 5 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 5 Readonly::Scalar my $UNDER => q{_};
16 5 Readonly::Scalar my $GETTER => q{get};
17 5 Readonly::Array my @TV_CHANNEL_CODES => qw(NL1 NL2 NL3);
18 5 Readonly::Array my @RADIO_CHANNEL_CODES => qw(RA1 RA2 RA3 RA4 RA5 RA6);
19  
20 5 has '_id' => (
21 'is' => 'ro',
22 'isa' => 'Int',
23 'reader' => 'get_id',
24 'init_arg' => 'id',
25 );
26  
27 5 has '_channel_icon' => (
28 'is' => 'ro',
29 'isa' => NOSURI,
30 'coerce' => 1,
31 'reader' => 'get_channel_icon',
32 'init_arg' => 'channel_icon',
33 );
34  
35 5 my @dates = qw(starttime endtime);
36 5 ▶while ( my $date = shift @dates ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $date = shift @dates) 10 5 15
37 10 has $UNDER
38 . $date => (
39 'is' => 'ro',
40 'isa' => NOSDateTime,
41 'coerce' => 1,
42 'reader' => $GETTER . $UNDER . $date,
43 'init_arg' => $date,
44 );
45 }
46  
47 5 has '_channel_code' => (
48 'is' => 'ro',
49 'isa' => enum( [ @TV_CHANNEL_CODES, @RADIO_CHANNEL_CODES ] ),
50 'reader' => 'get_channel_code',
51 'init_arg' => 'channel_code',
52 );
53  
54 5 my @strings = qw(type channel_name genre title description);
55 5 ▶while ( my $string = shift @strings ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $string = shift @strings) 25 5 30
56 25 has $UNDER
57 . $string => (
58 'is' => 'ro',
59 'isa' => 'Str',
60 'reader' => $GETTER . $UNDER . $string,
61 'init_arg' => $string,
62 );
63 }
64  
65 5 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
66  
67 5 __PACKAGE__->meta->make_immutable;
68  
69 5 1;
70  
71 __END__
72  
73 =encoding utf8
74  
75 =for stopwords DateTime URI Ipenburg MERCHANTABILITY
76  
77 =head1 NAME
78  
79 WWW::NOS::Open::Broadcast - client side broadcasts in the Open NOS REST API.
80  
81 =head1 VERSION
82  
83 This document describes WWW::NOS::Open::Broadcast version v1.0.3.
84  
85 =head1 SYNOPSIS
86  
87 use WWW::NOS::Open::Broadcast;
88  
89 =head1 DESCRIPTION
90  
91 =head1 SUBROUTINES/METHODS
92  
93 =head2 C<new>
94  
95 Create a new WWW::NOS::Open::Broadcast object.
96  
97 =over
98  
99 =item 1. A hash containing the properties and their values.
100  
101 =back
102  
103 =head2 C<get_id>
104  
105 Returns the id of the article as integer.
106  
107 =head2 C<get_title>
108  
109 Returns the title of the article as string.
110  
111 =head2 C<get_description>
112  
113 Returns the description of the article as string.
114  
115 =head2 C<get_published>
116  
117 Returns the publishing date of the article as a L<DateTime|DateTime> object.
118  
119 =head2 C<get_last_update>
120  
121 Returns the date of the last update for the article as a L<DateTime|DateTime>
122 object.
123  
124 =head2 C<get_thumbnail_xs>
125  
126 Returns the URL of the extra small thumbnail for the article as an L<URI|URI>
127 object.
128  
129 =head2 C<get_thumbnail_s>
130  
131 Returns the URL of the small thumbnail for the article as an L<URI|URI> object.
132  
133 =head2 C<get_thumbnail_m>
134  
135 Returns the URL of the medium sized thumbnail for the article as an L<URI|URI>
136 object.
137  
138 =head2 C<get_link>
139  
140 Returns the URL of the main article as an L<URI|URI> object.
141  
142 =head2 C<get_keywords>
143  
144 Returns the list of keywords for the article as a reference to an array of
145 strings.
146  
147 =head1 CONFIGURATION AND ENVIRONMENT
148  
149 =head1 DEPENDENCIES
150  
151 =over 4
152  
153 =item * L<DateTime|DateTime>
154  
155 =item * L<Date::Parse|Date::Parse>
156  
157 =item * L<URI|URI>
158  
159 =item * L<Moose|Moose>
160  
161 =item * L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints>
162  
163 =item * L<namespace::autoclean|namespace::autoclean>
164  
165 =back
166  
167 =head1 INCOMPATIBILITIES
168  
169 =head1 DIAGNOSTICS
170  
171 =head1 BUGS AND LIMITATIONS
172  
173 Please report any bugs or feature requests at
174 L<RT for rt.cpan.org|https://rt.cpan.org/Dist/Display.html?Queue=WWW-NOS-Open>.
175  
176 =head1 AUTHOR
177  
178 Roland van Ipenburg, E<lt>ipenburg@xs4all.nlE<gt>
179  
180 =head1 LICENSE AND COPYRIGHT
181  
182 Copyright 2012 by Roland van Ipenburg
183  
184 This library is free software; you can redistribute it and/or modify
185 it under the same terms as Perl itself, either Perl version 5.14.0 or,
186 at your option, any later version of Perl 5 you may have available.
187  
188 =head1 DISCLAIMER OF WARRANTY
189  
190 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
191 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
192 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
193 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
194 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
195 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
196 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
197 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
198 NECESSARY SERVICING, REPAIR, OR CORRECTION.
199  
200 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
201 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
202 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE
203 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
204 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
205 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
206 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
207 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
208 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
209 SUCH DAMAGES.
210  
211 =cut
« blib/lib/WWW/NOS/Open/AudioFragment.pm ↑ Summary blib/lib/WWW/NOS/Open/DayGuide.pm »