File Coverage

blib/lib/WWW/NOS/Open/DayGuide.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod n/a
total 39 39 100.0


line stmt bran cond sub pod time code
1             # -*- cperl; cperl-indent-level: 4 -*-
2             # Copyright (C) 2011-2021, Roland van Ipenburg
3             package WWW::NOS::Open::DayGuide v1.0.4;
4 4     4   34 use strict;
  4         13  
  4         148  
5 4     4   26 use warnings;
  4         11  
  4         257  
6              
7 4     4   26 use utf8;
  4         9  
  4         38  
8 4     4   168 use 5.014000;
  4         16  
9              
10 4     4   35 use Moose qw/around has with/;
  4         66  
  4         39  
11 4     4   24368 use Moose::Util::TypeConstraints qw/enum/;
  4         10  
  4         38  
12 4     4   1955 use namespace::autoclean '-also' => qr/^__/sxm;
  4         9  
  4         56  
13              
14 4     4   453 use WWW::NOS::Open::TypeDef qw(NOSDateTime NOSURI);
  4         19  
  4         43  
15              
16 4     4   6397 use Readonly;
  4         14  
  4         696  
17             Readonly::Array my @GUIDE_TYPES => qw(tv radio);
18              
19             has '_type' => (
20             'is' => 'ro',
21             'isa' => enum( [@GUIDE_TYPES] ),
22             'reader' => 'get_type',
23             'init_arg' => 'type',
24             );
25              
26             has '_date' => (
27             'is' => 'ro',
28             'isa' => NOSDateTime,
29             'coerce' => 1,
30             'reader' => 'get_date',
31             'init_arg' => 'date',
32             );
33              
34             has '_broadcasts' => (
35             'is' => 'ro',
36             'isa' => 'ArrayRef[WWW::NOS::Open::Broadcast]',
37             'reader' => 'get_broadcasts',
38             'init_arg' => 'broadcasts',
39             );
40              
41 4     4   33 no Moose;
  4         12  
  4         25  
42              
43             __PACKAGE__->meta->make_immutable;
44              
45             1;
46              
47             __END__
48              
49             =encoding utf8
50              
51             =for stopwords Bitbucket DateTime Ipenburg MERCHANTABILITY
52              
53             =head1 NAME
54              
55             WWW::NOS::Open::DayGuide - client side television or radio program guide
56              
57             =head1 VERSION
58              
59             This document describes WWW::NOS::Open::DayGuide version C<v1.0.4>.
60              
61             =head1 SYNOPSIS
62              
63             use WWW::NOS::Open::DayGuide;
64              
65             =head1 DESCRIPTION
66              
67             This class represents a guide containing the broadcasts for a day as returned
68             in the television and radio guide list for one or several days.
69              
70             =head1 SUBROUTINES/METHODS
71              
72             =head2 C<new>
73              
74             Create a new WWW::NOS::Open::DayGuide object.
75              
76             =over
77              
78             =item 1. A hash containing the properties and their values.
79              
80             =back
81              
82             =head2 C<get_type>
83              
84             Returns the type of the guide as string C<tv> or C<radio>.
85              
86             =head2 C<get_date>
87              
88             Returns the date of the guide as L<DateTime|DateTime> object.
89              
90             =head2 C<get_broadcasts>
91              
92             Returns the broadcasts for that day as a reference to an array of
93             L<WWW::NOS::Open::Broadcast|WWW::NOS::Open::Broadcast> objects.
94              
95             =head1 CONFIGURATION AND ENVIRONMENT
96              
97             =head1 DEPENDENCIES
98              
99             =over 4
100              
101             =item * L<Moose|Moose>
102              
103             =item * L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints>
104              
105             =item * L<namespace::autoclean|namespace::autoclean>
106              
107             =back
108              
109             =head1 INCOMPATIBILITIES
110              
111             =head1 DIAGNOSTICS
112              
113             =head1 BUGS AND LIMITATIONS
114              
115             Please report any bugs or feature requests at
116             L<Bitbucket|https://bitbucket.org/rolandvanipenburg/www-nos-open/issues>.
117              
118             =head1 AUTHOR
119              
120             Roland van Ipenburg, E<lt>roland@rolandvanipenburg.comE<gt>
121              
122             =head1 LICENSE AND COPYRIGHT
123              
124             Copyright 2011-2021 by Roland van Ipenburg
125              
126             This library is free software; you can redistribute it and/or modify
127             it under the same terms as Perl itself, either Perl version 5.14.0 or,
128             at your option, any later version of Perl 5 you may have available.
129              
130             =head1 DISCLAIMER OF WARRANTY
131              
132             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
133             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
134             OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
135             PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
136             EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
137             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
138             ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
139             YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
140             NECESSARY SERVICING, REPAIR, OR CORRECTION.
141              
142             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
143             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
144             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE
145             LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
146             OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
147             THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
148             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
149             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
150             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
151             SUCH DAMAGES.
152              
153             =cut