File Coverage

blib/lib/DateTime/Format/Strptime/Types.pm
Criterion Covered Total %
statement 33 33 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod n/a
total 44 44 100.0


line stmt bran cond sub pod time code
1             package DateTime::Format::Strptime::Types;
2              
3 12     12   103 use strict;
  12         34  
  12         438  
4 12     12   77 use warnings;
  12         27  
  12         592  
5              
6             our $VERSION = '1.78';
7              
8 12     12   79 use parent 'Specio::Exporter';
  12         27  
  12         96  
9              
10 12     12   862 use DateTime;
  12         29  
  12         231  
11 12     12   7066 use DateTime::Locale::Base;
  12         103791  
  12         494  
12 12     12   97 use DateTime::Locale::FromData;
  12         32  
  12         297  
13 12     12   69 use DateTime::TimeZone;
  12         28  
  12         307  
14 12     12   74 use Specio 0.33;
  12         263  
  12         281  
15 12     12   65 use Specio::Declare;
  12         32  
  12         56  
16 12     12   2371 use Specio::Library::Builtins -reexport;
  12         44  
  12         131  
17 12     12   118154 use Specio::Library::String -reexport;
  12         43  
  12         114  
18              
19             union(
20             'Locale',
21             of => [
22             object_isa_type('DateTime::Locale::Base'),
23             object_isa_type('DateTime::Locale::FromData'),
24             ],
25             );
26              
27             coerce(
28             t('Locale'),
29             from => t('NonEmptyStr'),
30             inline => sub {"DateTime::Locale->load( $_[1] )"},
31             );
32              
33             object_isa_type( 'TimeZone', class => 'DateTime::TimeZone' );
34             object_isa_type('DateTime');
35              
36             coerce(
37             t('TimeZone'),
38             from => t('NonEmptyStr'),
39             inline => sub {"DateTime::TimeZone->new( name => $_[1] )"},
40             );
41              
42             union(
43             'OnError',
44             of => [
45             enum( values => [ 'croak', 'undef' ] ),
46             t('CodeRef'),
47             ],
48             );
49              
50             1;
51              
52             # ABSTRACT: Types used for parameter checking in DateTime::Format::Strptime
53              
54             __END__
55              
56             =pod
57              
58             =encoding UTF-8
59              
60             =head1 NAME
61              
62             DateTime::Format::Strptime::Types - Types used for parameter checking in DateTime::Format::Strptime
63              
64             =head1 VERSION
65              
66             version 1.78
67              
68             =head1 DESCRIPTION
69              
70             This module has no user-facing parts.
71              
72             =for Pod::Coverage .*
73              
74             =head1 SUPPORT
75              
76             Bugs may be submitted at L<https://github.com/houseabsolute/DateTime-Format-Strptime/issues>.
77              
78             There is a mailing list available for users of this distribution,
79             L<mailto:datetime@perl.org>.
80              
81             I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>.
82              
83             =head1 SOURCE
84              
85             The source code repository for DateTime-Format-Strptime can be found at L<https://github.com/houseabsolute/DateTime-Format-Strptime>.
86              
87             =head1 AUTHORS
88              
89             =over 4
90              
91             =item *
92              
93             Dave Rolsky <autarch@urth.org>
94              
95             =item *
96              
97             Rick Measham <rickm@cpan.org>
98              
99             =back
100              
101             =head1 COPYRIGHT AND LICENSE
102              
103             This software is Copyright (c) 2015 - 2020 by Dave Rolsky.
104              
105             This is free software, licensed under:
106              
107             The Artistic License 2.0 (GPL Compatible)
108              
109             The full text of the license can be found in the
110             F<LICENSE> file included with this distribution.
111              
112             =cut