Strptime/Types.pm

filter: Statementstmt 100% 44 / 44 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 13 / 13 Podpod n/a totaltotal 100% 57 / 57 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Strptime.pm ↑ Summary
1 package DateTime::Format::Strptime::Types;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 12 our $VERSION = '1.80';
7  
8 12 ▶use parent 'Specio::Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 12 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 12 ▶use DateTime::Locale::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 12 ▶use DateTime::Locale::FromData;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 12 ▶use DateTime::TimeZone;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 12 ▶use Specio 0.33;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 12 ▶use Specio::Declare;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 12 ▶use Specio::Library::Builtins -reexport;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 12 ▶use Specio::Library::String -reexport;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 12 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 12 ▶ inline => sub {"DateTime::Locale->load( $_[1] )"},
Subroutine __ANON__: called CC=1 SCAR=0.0
31 12 );
32  
33 12 object_isa_type('DateTime');
34  
35 12 my $time_zone_object = object_can_type(
36 'TZObject',
37 methods => [
38 qw(
39 is_floating
40 is_utc
41 name
42 offset_for_datetime
43 short_name_for_datetime
44 )
45 ],
46 );
47  
48 12 declare(
49 'TimeZone',
50 of => [ t('NonEmptySimpleStr'), $time_zone_object ],
51 );
52  
53 coerce(
54 t('TimeZone'),
55 from => t('NonEmptyStr'),
56 12 ▶ inline => sub {"DateTime::TimeZone->new( name => $_[1] )"},
Subroutine __ANON__: called CC=1 SCAR=0.0
57 12 );
58  
59 12 union(
60 'OnError',
61 of => [
62 enum( values => [ 'croak', 'undef' ] ),
63 t('CodeRef'),
64 ],
65 );
66  
67 12 1;
68  
69 # ABSTRACT: Types used for parameter checking in DateTime::Format::Strptime
70  
71 __END__
« Strptime.pm ↑ Summary