File Coverage

blib/lib/WWW/NOS/Open/TypeDef.pm
Criterion Covered Total %
statement 38 38 100.0
branch n/a
condition n/a
subroutine 13 13 100.0
pod n/a
total 51 51 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::TypeDef v1.0.5;
4 4     4   27 use strict;
  4         9  
  4         115  
5 4     4   18 use warnings;
  4         9  
  4         100  
6              
7 4     4   19 use utf8;
  4         6  
  4         28  
8 4     4   183 use 5.014000;
  4         13  
9              
10 4     4   3880 use DateTime;
  4         1606814  
  4         179  
11 4     4   2231 use Date::Parse;
  4         9807  
  4         479  
12 4     4   30 use Moose qw/around has with/;
  4         8  
  4         41  
13 4     4   21148 use Moose::Util::TypeConstraints qw/as coerce from where subtype via/;
  4         9  
  4         36  
14 4     4   3245 use MooseX::Types '-declare' => [qw(NOSURI NOSDateTime)];
  4         10  
  4         39  
15 4     4   18390 use MooseX::Types::Moose qw/Str/;
  4         8  
  4         37  
16 4     4   16711 use URI;
  4         8  
  4         220  
17 4     4   26 use namespace::autoclean '-also' => qr/^__/sxm;
  4         7  
  4         46  
18              
19             ## no critic qw(ProhibitCallsToUndeclaredSubs)
20             class_type NOSURI, { 'class' => 'URI' };
21             coerce NOSURI, from Str, via { URI->new($_) };
22              
23             class_type NOSDateTime, { 'class' => 'DateTime' };
24             coerce NOSDateTime,
25             ## use critic
26             from Str,
27             via { DateTime->from_epoch( 'epoch' => Date::Parse::str2time($_) ) };
28              
29 4     4   867 no Moose;
  4         9  
  4         23  
30              
31             __PACKAGE__->meta->make_immutable;
32              
33             1;
34              
35             __END__
36              
37             =encoding utf8
38              
39             =for stopwords Bitbucket DateTime URI Ipenburg MERCHANTABILITY
40              
41             =head1 NAME
42              
43             WWW::NOS::Open::TypeDef - types for the Open NOS REST API.
44              
45             =head1 VERSION
46              
47             This document describes WWW::NOS::Open::TypeDef version C<v1.0.5>.
48              
49             =head1 SYNOPSIS
50              
51             use WWW::NOS::Open::TypeDef qw(NOSDateTime NOSURI);
52              
53             =head1 DESCRIPTION
54              
55             =head1 SUBROUTINES/METHODS
56              
57             =head1 CONFIGURATION AND ENVIRONMENT
58              
59             =head1 DEPENDENCIES
60              
61             =over 4
62              
63             =item * L<DateTime|DateTime>
64              
65             =item * L<Date::Parse|Date::Parse>
66              
67             =item * L<Moose|Moose>
68              
69             =item * L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints>
70              
71             =item * L<MooseX::Types|MooseX::Types>
72              
73             =item * L<MooseX::Types::Moose|MooseX::Types::Moose>
74              
75             =item * L<URI|URI>
76              
77             =item * L<namespace::autoclean|namespace::autoclean>
78              
79             =back
80              
81             =head1 INCOMPATIBILITIES
82              
83             =head1 DIAGNOSTICS
84              
85             =head1 BUGS AND LIMITATIONS
86              
87             Please report any bugs or feature requests at
88             L<Bitbucket|https://bitbucket.org/rolandvanipenburg/www-nos-open/issues>.
89              
90             =head1 AUTHOR
91              
92             Roland van Ipenburg, E<lt>roland@rolandvanipenburg.comE<gt>
93              
94             =head1 LICENSE AND COPYRIGHT
95              
96             Copyright 2011-2021 by Roland van Ipenburg
97              
98             This library is free software; you can redistribute it and/or modify
99             it under the same terms as Perl itself, either Perl version 5.14.0 or,
100             at your option, any later version of Perl 5 you may have available.
101              
102             =head1 DISCLAIMER OF WARRANTY
103              
104             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
105             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
106             OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
107             PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
108             EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
109             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
110             ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
111             YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
112             NECESSARY SERVICING, REPAIR, OR CORRECTION.
113              
114             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
115             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
116             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE
117             LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
118             OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
119             THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
120             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
121             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
122             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
123             SUCH DAMAGES.
124              
125             =cut