| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
10
|
|
|
10
|
|
177
|
use 5.008001; |
|
|
10
|
|
|
|
|
34
|
|
|
2
|
10
|
|
|
10
|
|
57
|
use strict; |
|
|
10
|
|
|
|
|
19
|
|
|
|
10
|
|
|
|
|
200
|
|
|
3
|
10
|
|
|
10
|
|
51
|
use warnings; |
|
|
10
|
|
|
|
|
20
|
|
|
|
10
|
|
|
|
|
316
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Types; |
|
6
|
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
|
54
|
use Exporter (); |
|
|
10
|
|
|
|
|
20
|
|
|
|
10
|
|
|
|
|
231
|
|
|
8
|
10
|
|
|
10
|
|
52
|
use Carp qw( croak ); |
|
|
10
|
|
|
|
|
19
|
|
|
|
10
|
|
|
|
|
2567
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $TLC_VERSION = "0.007"; |
|
11
|
|
|
|
|
|
|
our @ISA = qw( Exporter ); |
|
12
|
|
|
|
|
|
|
our @EXPORT; |
|
13
|
|
|
|
|
|
|
our @EXPORT_OK; |
|
14
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
|
15
|
|
|
|
|
|
|
is => [], |
|
16
|
|
|
|
|
|
|
types => [], |
|
17
|
|
|
|
|
|
|
assert => [], |
|
18
|
|
|
|
|
|
|
); |
|
19
|
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
0
|
BEGIN { |
|
21
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Types::TypeConstraint; |
|
22
|
10
|
|
|
10
|
|
15353
|
our $LIBRARY = "Acme::Mitey::Cards::Types"; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use overload ( |
|
25
|
|
|
|
|
|
|
fallback => !!1, |
|
26
|
|
|
|
|
|
|
'|' => 'union', |
|
27
|
109
|
|
|
109
|
|
671
|
bool => sub { !! 1 }, |
|
28
|
0
|
|
|
0
|
|
0
|
'""' => sub { shift->{name} }, |
|
29
|
|
|
|
|
|
|
'&{}' => sub { |
|
30
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
|
31
|
0
|
|
|
0
|
|
0
|
return sub { $self->assert_return( @_ ) }; |
|
|
0
|
|
|
|
|
0
|
|
|
32
|
|
|
|
|
|
|
}, |
|
33
|
10
|
|
|
10
|
|
2445
|
); |
|
|
10
|
|
|
|
|
2030
|
|
|
|
10
|
|
|
|
|
157
|
|
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub union { |
|
36
|
4
|
|
|
4
|
|
27
|
my @types = grep ref( $_ ), @_; |
|
37
|
4
|
|
|
|
|
30
|
my @checks = map $_->{check}, @types; |
|
38
|
|
|
|
|
|
|
bless { |
|
39
|
0
|
0
|
|
0
|
|
0
|
check => sub { for ( @checks ) { return 1 if $_->(@_) } return 0 }, |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
40
|
4
|
|
|
|
|
65
|
name => join( '|', map $_->{name}, @types ), |
|
41
|
|
|
|
|
|
|
union => \@types, |
|
42
|
|
|
|
|
|
|
}, __PACKAGE__; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub check { |
|
46
|
0
|
|
|
0
|
|
0
|
$_[0]{check}->( $_[1] ); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub get_message { |
|
50
|
|
|
|
|
|
|
sprintf '%s did not pass type constraint "%s"', |
|
51
|
|
|
|
|
|
|
defined( $_[1] ) ? $_[1] : 'Undef', |
|
52
|
0
|
0
|
|
0
|
|
0
|
$_[0]{name}; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub validate { |
|
56
|
0
|
0
|
|
0
|
|
0
|
$_[0]{check}->( $_[1] ) |
|
57
|
|
|
|
|
|
|
? undef |
|
58
|
|
|
|
|
|
|
: $_[0]->get_message( $_[1] ); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub assert_valid { |
|
62
|
0
|
0
|
|
0
|
|
0
|
$_[0]{check}->( $_[1] ) |
|
63
|
|
|
|
|
|
|
? 1 |
|
64
|
|
|
|
|
|
|
: Carp::croak( $_[0]->get_message( $_[1] ) ); |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub assert_return { |
|
68
|
0
|
0
|
|
0
|
|
0
|
$_[0]{check}->( $_[1] ) |
|
69
|
|
|
|
|
|
|
? $_[1] |
|
70
|
|
|
|
|
|
|
: Carp::croak( $_[0]->get_message( $_[1] ) ); |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub to_TypeTiny { |
|
74
|
0
|
0
|
|
0
|
|
0
|
if ( $_[0]{union} ) { |
|
75
|
0
|
|
|
|
|
0
|
require Type::Tiny::Union; |
|
76
|
|
|
|
|
|
|
return 'Type::Tiny::Union'->new( |
|
77
|
|
|
|
|
|
|
display_name => $_[0]{name}, |
|
78
|
0
|
|
|
|
|
0
|
type_constraints => [ map $_->to_TypeTiny, @{ $_[0]{union} } ], |
|
|
0
|
|
|
|
|
0
|
|
|
79
|
|
|
|
|
|
|
); |
|
80
|
|
|
|
|
|
|
} |
|
81
|
0
|
0
|
|
|
|
0
|
if ( my $library = $_[0]{library} ) { |
|
82
|
0
|
|
|
|
|
0
|
local $@; |
|
83
|
0
|
0
|
|
|
|
0
|
eval "require $library; 1" or die $@; |
|
84
|
0
|
|
|
|
|
0
|
my $type = $library->get_type( $_[0]{library_name} ); |
|
85
|
0
|
0
|
|
|
|
0
|
return $type if $type; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
0
|
|
|
|
|
0
|
require Type::Tiny; |
|
88
|
0
|
|
|
|
|
0
|
my $check = $_[0]{check}; |
|
89
|
0
|
|
|
|
|
0
|
my $name = $_[0]{name}; |
|
90
|
|
|
|
|
|
|
return 'Type::Tiny'->new( |
|
91
|
|
|
|
|
|
|
name => $name, |
|
92
|
0
|
|
|
0
|
|
0
|
constraint => sub { $check->( $_ ) }, |
|
93
|
0
|
|
|
0
|
|
0
|
inlined => sub { sprintf '%s::is_%s(%s)', $LIBRARY, $name, pop } |
|
94
|
0
|
|
|
|
|
0
|
); |
|
95
|
|
|
|
|
|
|
} |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub DOES { |
|
98
|
0
|
0
|
|
0
|
|
0
|
return 1 if $_[1] eq 'Type::API::Constraint'; |
|
99
|
0
|
0
|
|
|
|
0
|
return 1 if $_[1] eq 'Type::Library::Compiler::TypeConstraint'; |
|
100
|
0
|
|
|
|
|
0
|
shift->DOES( @_ ); |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
}; |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# Any |
|
105
|
|
|
|
|
|
|
{ |
|
106
|
|
|
|
|
|
|
my $type; |
|
107
|
|
|
|
|
|
|
sub Any () { |
|
108
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Any, name => "Any", library => "Types::Standard", library_name => "Any" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
109
|
|
|
|
|
|
|
} |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub is_Any ($) { |
|
112
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub assert_Any ($) { |
|
116
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Any->get_message( $_[0] ); |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
$EXPORT_TAGS{"Any"} = [ qw( Any is_Any assert_Any ) ]; |
|
120
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Any"} }; |
|
121
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Any"; |
|
122
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Any"; |
|
123
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Any"; |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
# ArrayRef |
|
128
|
|
|
|
|
|
|
{ |
|
129
|
|
|
|
|
|
|
my $type; |
|
130
|
|
|
|
|
|
|
sub ArrayRef () { |
|
131
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_ArrayRef, name => "ArrayRef", library => "Types::Standard", library_name => "ArrayRef" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub is_ArrayRef ($) { |
|
135
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub assert_ArrayRef ($) { |
|
139
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') ? $_[0] : ArrayRef->get_message( $_[0] ); |
|
140
|
|
|
|
|
|
|
} |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
$EXPORT_TAGS{"ArrayRef"} = [ qw( ArrayRef is_ArrayRef assert_ArrayRef ) ]; |
|
143
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ArrayRef"} }; |
|
144
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ArrayRef"; |
|
145
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ArrayRef"; |
|
146
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ArrayRef"; |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# Bool |
|
151
|
|
|
|
|
|
|
{ |
|
152
|
|
|
|
|
|
|
my $type; |
|
153
|
|
|
|
|
|
|
sub Bool () { |
|
154
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Bool, name => "Bool", library => "Types::Standard", library_name => "Bool" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
155
|
|
|
|
|
|
|
} |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub is_Bool ($) { |
|
158
|
0
|
0
|
0
|
0
|
0
|
0
|
(!ref $_[0] and (!defined $_[0] or $_[0] eq q() or $_[0] eq '0' or $_[0] eq '1')) |
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
159
|
|
|
|
|
|
|
} |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub assert_Bool ($) { |
|
162
|
0
|
0
|
0
|
0
|
0
|
0
|
(!ref $_[0] and (!defined $_[0] or $_[0] eq q() or $_[0] eq '0' or $_[0] eq '1')) ? $_[0] : Bool->get_message( $_[0] ); |
|
163
|
|
|
|
|
|
|
} |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
$EXPORT_TAGS{"Bool"} = [ qw( Bool is_Bool assert_Bool ) ]; |
|
166
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Bool"} }; |
|
167
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Bool"; |
|
168
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Bool"; |
|
169
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Bool"; |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
# Card |
|
174
|
|
|
|
|
|
|
{ |
|
175
|
|
|
|
|
|
|
my $type; |
|
176
|
|
|
|
|
|
|
sub Card () { |
|
177
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Card, name => "Card", library => "Acme::Mitey::Cards::Types::Source", library_name => "Card" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
178
|
|
|
|
|
|
|
} |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub is_Card ($) { |
|
181
|
10
|
0
|
|
10
|
0
|
143
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card]) }) |
|
|
10
|
|
|
0
|
|
24
|
|
|
|
10
|
|
|
|
|
751
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
182
|
|
|
|
|
|
|
} |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub assert_Card ($) { |
|
185
|
10
|
0
|
|
10
|
0
|
81
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card]) }) ? $_[0] : Card->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
22
|
|
|
|
10
|
|
|
|
|
2321
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
186
|
|
|
|
|
|
|
} |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
$EXPORT_TAGS{"Card"} = [ qw( Card is_Card assert_Card ) ]; |
|
189
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Card"} }; |
|
190
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Card"; |
|
191
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Card"; |
|
192
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Card"; |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
} |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
# CardArray |
|
197
|
|
|
|
|
|
|
{ |
|
198
|
|
|
|
|
|
|
my $type; |
|
199
|
|
|
|
|
|
|
sub CardArray () { |
|
200
|
8
|
|
100
|
8
|
1
|
178
|
$type ||= bless( { check => \&is_CardArray, name => "CardArray", library => "Acme::Mitey::Cards::Types::Source", library_name => "CardArray" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
201
|
|
|
|
|
|
|
} |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
sub is_CardArray ($) { |
|
204
|
10
|
0
|
|
10
|
0
|
177
|
do { (ref($_[0]) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$_[0]}) { ($ok = 0, last) unless (do { use Scalar::Util (); Scalar::Util::blessed($i) and $i->isa(q[Acme::Mitey::Cards::Card]) }) }; $ok } } |
|
|
10
|
0
|
|
0
|
|
24
|
|
|
|
10
|
0
|
|
|
|
1178
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
205
|
|
|
|
|
|
|
} |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
sub assert_CardArray ($) { |
|
208
|
10
|
0
|
|
10
|
0
|
74
|
do { (ref($_[0]) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$_[0]}) { ($ok = 0, last) unless (do { use Scalar::Util (); Scalar::Util::blessed($i) and $i->isa(q[Acme::Mitey::Cards::Card]) }) }; $ok } } ? $_[0] : CardArray->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
16
|
|
|
|
10
|
0
|
|
|
|
8399
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
209
|
|
|
|
|
|
|
} |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
$EXPORT_TAGS{"CardArray"} = [ qw( CardArray is_CardArray assert_CardArray ) ]; |
|
212
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CardArray"} }; |
|
213
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CardArray"; |
|
214
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CardArray"; |
|
215
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CardArray"; |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
# CardNumber |
|
220
|
|
|
|
|
|
|
{ |
|
221
|
|
|
|
|
|
|
my $type; |
|
222
|
|
|
|
|
|
|
sub CardNumber () { |
|
223
|
4
|
|
50
|
4
|
1
|
36
|
$type ||= bless( { check => \&is_CardNumber, name => "CardNumber", library => "Acme::Mitey::Cards::Types::Source", library_name => "CardNumber" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
224
|
|
|
|
|
|
|
} |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
sub is_CardNumber ($) { |
|
227
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 1) && ($_[0] <= 10)) |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
sub assert_CardNumber ($) { |
|
231
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 1) && ($_[0] <= 10)) ? $_[0] : CardNumber->get_message( $_[0] ); |
|
232
|
|
|
|
|
|
|
} |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
$EXPORT_TAGS{"CardNumber"} = [ qw( CardNumber is_CardNumber assert_CardNumber ) ]; |
|
235
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CardNumber"} }; |
|
236
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CardNumber"; |
|
237
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CardNumber"; |
|
238
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CardNumber"; |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
} |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
# Character |
|
243
|
|
|
|
|
|
|
{ |
|
244
|
|
|
|
|
|
|
my $type; |
|
245
|
|
|
|
|
|
|
sub Character () { |
|
246
|
4
|
|
50
|
4
|
1
|
58
|
$type ||= bless( { check => \&is_Character, name => "Character", library => "Acme::Mitey::Cards::Types::Source", library_name => "Character" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
sub is_Character ($) { |
|
250
|
0
|
0
|
0
|
0
|
0
|
0
|
do { (defined($_[0]) and !ref($_[0]) and $_[0] =~ m{\A(?:(?:Jack|King|Queen))\z}) } |
|
|
0
|
|
|
|
|
0
|
|
|
251
|
|
|
|
|
|
|
} |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub assert_Character ($) { |
|
254
|
0
|
0
|
0
|
0
|
0
|
0
|
do { (defined($_[0]) and !ref($_[0]) and $_[0] =~ m{\A(?:(?:Jack|King|Queen))\z}) } ? $_[0] : Character->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
255
|
|
|
|
|
|
|
} |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
$EXPORT_TAGS{"Character"} = [ qw( Character is_Character assert_Character ) ]; |
|
258
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Character"} }; |
|
259
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Character"; |
|
260
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Character"; |
|
261
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Character"; |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
} |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# ClassName |
|
266
|
|
|
|
|
|
|
{ |
|
267
|
|
|
|
|
|
|
my $type; |
|
268
|
|
|
|
|
|
|
sub ClassName () { |
|
269
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_ClassName, name => "ClassName", library => "Types::Standard", library_name => "ClassName" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
270
|
|
|
|
|
|
|
} |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
sub is_ClassName ($) { |
|
273
|
0
|
|
|
0
|
0
|
0
|
do { (sub { |
|
274
|
10
|
|
|
10
|
|
81
|
no strict 'refs'; |
|
|
10
|
|
|
|
|
28
|
|
|
|
10
|
|
|
|
|
3147
|
|
|
275
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
276
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
277
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
278
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
279
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
280
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
281
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
282
|
|
|
|
|
|
|
return !!1 |
|
283
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
284
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
285
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
} |
|
287
|
0
|
|
|
|
|
0
|
return !!0; |
|
288
|
0
|
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) } |
|
|
0
|
|
|
|
|
0
|
|
|
289
|
|
|
|
|
|
|
} |
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
sub assert_ClassName ($) { |
|
292
|
0
|
0
|
|
0
|
0
|
0
|
do { (sub { |
|
293
|
10
|
|
|
10
|
|
79
|
no strict 'refs'; |
|
|
10
|
|
|
|
|
23
|
|
|
|
10
|
|
|
|
|
5669
|
|
|
294
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
295
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
296
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
297
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
298
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
299
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
300
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
301
|
|
|
|
|
|
|
return !!1 |
|
302
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
303
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
304
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
} |
|
306
|
0
|
|
|
|
|
0
|
return !!0; |
|
307
|
0
|
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) } ? $_[0] : ClassName->get_message( $_[0] ); |
|
|
0
|
|
|
|
|
0
|
|
|
308
|
|
|
|
|
|
|
} |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
$EXPORT_TAGS{"ClassName"} = [ qw( ClassName is_ClassName assert_ClassName ) ]; |
|
311
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ClassName"} }; |
|
312
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ClassName"; |
|
313
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ClassName"; |
|
314
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ClassName"; |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
} |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
# CodeRef |
|
319
|
|
|
|
|
|
|
{ |
|
320
|
|
|
|
|
|
|
my $type; |
|
321
|
|
|
|
|
|
|
sub CodeRef () { |
|
322
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_CodeRef, name => "CodeRef", library => "Types::Standard", library_name => "CodeRef" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
323
|
|
|
|
|
|
|
} |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
sub is_CodeRef ($) { |
|
326
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'CODE') |
|
327
|
|
|
|
|
|
|
} |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
sub assert_CodeRef ($) { |
|
330
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'CODE') ? $_[0] : CodeRef->get_message( $_[0] ); |
|
331
|
|
|
|
|
|
|
} |
|
332
|
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
$EXPORT_TAGS{"CodeRef"} = [ qw( CodeRef is_CodeRef assert_CodeRef ) ]; |
|
334
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CodeRef"} }; |
|
335
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CodeRef"; |
|
336
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CodeRef"; |
|
337
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CodeRef"; |
|
338
|
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
} |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
# ConsumerOf |
|
342
|
|
|
|
|
|
|
{ |
|
343
|
|
|
|
|
|
|
my $type; |
|
344
|
|
|
|
|
|
|
sub ConsumerOf () { |
|
345
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_ConsumerOf, name => "ConsumerOf", library => "Types::Standard", library_name => "ConsumerOf" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
346
|
|
|
|
|
|
|
} |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
sub is_ConsumerOf ($) { |
|
349
|
10
|
|
|
10
|
0
|
90
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
10
|
|
|
0
|
|
29
|
|
|
|
10
|
|
|
|
|
553
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
350
|
|
|
|
|
|
|
} |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
sub assert_ConsumerOf ($) { |
|
353
|
10
|
0
|
|
10
|
0
|
63
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : ConsumerOf->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
19
|
|
|
|
10
|
|
|
|
|
4012
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
354
|
|
|
|
|
|
|
} |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
$EXPORT_TAGS{"ConsumerOf"} = [ qw( ConsumerOf is_ConsumerOf assert_ConsumerOf ) ]; |
|
357
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ConsumerOf"} }; |
|
358
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ConsumerOf"; |
|
359
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ConsumerOf"; |
|
360
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ConsumerOf"; |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
} |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
# CycleTuple |
|
365
|
|
|
|
|
|
|
{ |
|
366
|
|
|
|
|
|
|
my $type; |
|
367
|
|
|
|
|
|
|
sub CycleTuple () { |
|
368
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_CycleTuple, name => "CycleTuple", library => "Types::Standard", library_name => "CycleTuple" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
369
|
|
|
|
|
|
|
} |
|
370
|
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
sub is_CycleTuple ($) { |
|
372
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') |
|
373
|
|
|
|
|
|
|
} |
|
374
|
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
sub assert_CycleTuple ($) { |
|
376
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'ARRAY') ? $_[0] : CycleTuple->get_message( $_[0] ); |
|
377
|
|
|
|
|
|
|
} |
|
378
|
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
$EXPORT_TAGS{"CycleTuple"} = [ qw( CycleTuple is_CycleTuple assert_CycleTuple ) ]; |
|
380
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"CycleTuple"} }; |
|
381
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "CycleTuple"; |
|
382
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_CycleTuple"; |
|
383
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_CycleTuple"; |
|
384
|
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
} |
|
386
|
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
# Deck |
|
388
|
|
|
|
|
|
|
{ |
|
389
|
|
|
|
|
|
|
my $type; |
|
390
|
|
|
|
|
|
|
sub Deck () { |
|
391
|
9
|
|
50
|
9
|
1
|
329
|
$type ||= bless( { check => \&is_Deck, name => "Deck", library => "Acme::Mitey::Cards::Types::Source", library_name => "Deck" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
392
|
|
|
|
|
|
|
} |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
sub is_Deck ($) { |
|
395
|
10
|
0
|
|
10
|
0
|
81
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Deck]) }) |
|
|
10
|
|
|
0
|
|
23
|
|
|
|
10
|
|
|
|
|
723
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
396
|
|
|
|
|
|
|
} |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
sub assert_Deck ($) { |
|
399
|
10
|
0
|
|
10
|
0
|
64
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Deck]) }) ? $_[0] : Deck->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
20
|
|
|
|
10
|
|
|
|
|
10600
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
400
|
|
|
|
|
|
|
} |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
$EXPORT_TAGS{"Deck"} = [ qw( Deck is_Deck assert_Deck ) ]; |
|
403
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Deck"} }; |
|
404
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Deck"; |
|
405
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Deck"; |
|
406
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Deck"; |
|
407
|
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
} |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
# Defined |
|
411
|
|
|
|
|
|
|
{ |
|
412
|
|
|
|
|
|
|
my $type; |
|
413
|
|
|
|
|
|
|
sub Defined () { |
|
414
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Defined, name => "Defined", library => "Types::Standard", library_name => "Defined" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
415
|
|
|
|
|
|
|
} |
|
416
|
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
sub is_Defined ($) { |
|
418
|
0
|
|
|
0
|
0
|
0
|
(defined($_[0])) |
|
419
|
|
|
|
|
|
|
} |
|
420
|
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
sub assert_Defined ($) { |
|
422
|
0
|
0
|
|
0
|
0
|
0
|
(defined($_[0])) ? $_[0] : Defined->get_message( $_[0] ); |
|
423
|
|
|
|
|
|
|
} |
|
424
|
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
$EXPORT_TAGS{"Defined"} = [ qw( Defined is_Defined assert_Defined ) ]; |
|
426
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Defined"} }; |
|
427
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Defined"; |
|
428
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Defined"; |
|
429
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Defined"; |
|
430
|
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
} |
|
432
|
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
# DelimitedStr |
|
434
|
|
|
|
|
|
|
{ |
|
435
|
|
|
|
|
|
|
my $type; |
|
436
|
|
|
|
|
|
|
sub DelimitedStr () { |
|
437
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_DelimitedStr, name => "DelimitedStr", library => "Types::Common::String", library_name => "DelimitedStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
438
|
|
|
|
|
|
|
} |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
sub is_DelimitedStr ($) { |
|
441
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
442
|
|
|
|
|
|
|
} |
|
443
|
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
sub assert_DelimitedStr ($) { |
|
445
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : DelimitedStr->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
446
|
|
|
|
|
|
|
} |
|
447
|
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
$EXPORT_TAGS{"DelimitedStr"} = [ qw( DelimitedStr is_DelimitedStr assert_DelimitedStr ) ]; |
|
449
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"DelimitedStr"} }; |
|
450
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "DelimitedStr"; |
|
451
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_DelimitedStr"; |
|
452
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_DelimitedStr"; |
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
} |
|
455
|
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
# Dict |
|
457
|
|
|
|
|
|
|
{ |
|
458
|
|
|
|
|
|
|
my $type; |
|
459
|
|
|
|
|
|
|
sub Dict () { |
|
460
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Dict, name => "Dict", library => "Types::Standard", library_name => "Dict" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
461
|
|
|
|
|
|
|
} |
|
462
|
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
sub is_Dict ($) { |
|
464
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') |
|
465
|
|
|
|
|
|
|
} |
|
466
|
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
sub assert_Dict ($) { |
|
468
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') ? $_[0] : Dict->get_message( $_[0] ); |
|
469
|
|
|
|
|
|
|
} |
|
470
|
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
$EXPORT_TAGS{"Dict"} = [ qw( Dict is_Dict assert_Dict ) ]; |
|
472
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Dict"} }; |
|
473
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Dict"; |
|
474
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Dict"; |
|
475
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Dict"; |
|
476
|
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
} |
|
478
|
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
# Enum |
|
480
|
|
|
|
|
|
|
{ |
|
481
|
|
|
|
|
|
|
my $type; |
|
482
|
|
|
|
|
|
|
sub Enum () { |
|
483
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Enum, name => "Enum", library => "Types::Standard", library_name => "Enum" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
484
|
|
|
|
|
|
|
} |
|
485
|
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
sub is_Enum ($) { |
|
487
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
488
|
|
|
|
|
|
|
} |
|
489
|
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
sub assert_Enum ($) { |
|
491
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : Enum->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
492
|
|
|
|
|
|
|
} |
|
493
|
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
$EXPORT_TAGS{"Enum"} = [ qw( Enum is_Enum assert_Enum ) ]; |
|
495
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Enum"} }; |
|
496
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Enum"; |
|
497
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Enum"; |
|
498
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Enum"; |
|
499
|
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
} |
|
501
|
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
# FaceCard |
|
503
|
|
|
|
|
|
|
{ |
|
504
|
|
|
|
|
|
|
my $type; |
|
505
|
|
|
|
|
|
|
sub FaceCard () { |
|
506
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_FaceCard, name => "FaceCard", library => "Acme::Mitey::Cards::Types::Source", library_name => "FaceCard" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
507
|
|
|
|
|
|
|
} |
|
508
|
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
sub is_FaceCard ($) { |
|
510
|
10
|
0
|
|
10
|
0
|
77
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Face]) }) |
|
|
10
|
|
|
0
|
|
22
|
|
|
|
10
|
|
|
|
|
715
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
511
|
|
|
|
|
|
|
} |
|
512
|
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
sub assert_FaceCard ($) { |
|
514
|
10
|
0
|
|
10
|
0
|
71
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Face]) }) ? $_[0] : FaceCard->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
23
|
|
|
|
10
|
|
|
|
|
2318
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
515
|
|
|
|
|
|
|
} |
|
516
|
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
$EXPORT_TAGS{"FaceCard"} = [ qw( FaceCard is_FaceCard assert_FaceCard ) ]; |
|
518
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"FaceCard"} }; |
|
519
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "FaceCard"; |
|
520
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_FaceCard"; |
|
521
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_FaceCard"; |
|
522
|
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
} |
|
524
|
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
# FileHandle |
|
526
|
|
|
|
|
|
|
{ |
|
527
|
|
|
|
|
|
|
my $type; |
|
528
|
|
|
|
|
|
|
sub FileHandle () { |
|
529
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_FileHandle, name => "FileHandle", library => "Types::Standard", library_name => "FileHandle" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
530
|
|
|
|
|
|
|
} |
|
531
|
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
sub is_FileHandle ($) { |
|
533
|
10
|
0
|
0
|
10
|
0
|
71
|
(do { use Scalar::Util (); (ref($_[0]) && Scalar::Util::openhandle($_[0])) or (Scalar::Util::blessed($_[0]) && $_[0]->isa("IO::Handle")) }) |
|
|
10
|
|
0
|
0
|
|
27
|
|
|
|
10
|
|
|
|
|
944
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
534
|
|
|
|
|
|
|
} |
|
535
|
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
sub assert_FileHandle ($) { |
|
537
|
10
|
0
|
0
|
10
|
0
|
72
|
(do { use Scalar::Util (); (ref($_[0]) && Scalar::Util::openhandle($_[0])) or (Scalar::Util::blessed($_[0]) && $_[0]->isa("IO::Handle")) }) ? $_[0] : FileHandle->get_message( $_[0] ); |
|
|
10
|
0
|
0
|
0
|
|
28
|
|
|
|
10
|
|
|
|
|
4141
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
538
|
|
|
|
|
|
|
} |
|
539
|
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
$EXPORT_TAGS{"FileHandle"} = [ qw( FileHandle is_FileHandle assert_FileHandle ) ]; |
|
541
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"FileHandle"} }; |
|
542
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "FileHandle"; |
|
543
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_FileHandle"; |
|
544
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_FileHandle"; |
|
545
|
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
} |
|
547
|
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
# GlobRef |
|
549
|
|
|
|
|
|
|
{ |
|
550
|
|
|
|
|
|
|
my $type; |
|
551
|
|
|
|
|
|
|
sub GlobRef () { |
|
552
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_GlobRef, name => "GlobRef", library => "Types::Standard", library_name => "GlobRef" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
553
|
|
|
|
|
|
|
} |
|
554
|
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
sub is_GlobRef ($) { |
|
556
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'GLOB') |
|
557
|
|
|
|
|
|
|
} |
|
558
|
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
sub assert_GlobRef ($) { |
|
560
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'GLOB') ? $_[0] : GlobRef->get_message( $_[0] ); |
|
561
|
|
|
|
|
|
|
} |
|
562
|
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
$EXPORT_TAGS{"GlobRef"} = [ qw( GlobRef is_GlobRef assert_GlobRef ) ]; |
|
564
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"GlobRef"} }; |
|
565
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "GlobRef"; |
|
566
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_GlobRef"; |
|
567
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_GlobRef"; |
|
568
|
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
} |
|
570
|
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
# Hand |
|
572
|
|
|
|
|
|
|
{ |
|
573
|
|
|
|
|
|
|
my $type; |
|
574
|
|
|
|
|
|
|
sub Hand () { |
|
575
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Hand, name => "Hand", library => "Acme::Mitey::Cards::Types::Source", library_name => "Hand" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
576
|
|
|
|
|
|
|
} |
|
577
|
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
sub is_Hand ($) { |
|
579
|
10
|
0
|
|
10
|
0
|
73
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Hand]) }) |
|
|
10
|
|
|
0
|
|
39
|
|
|
|
10
|
|
|
|
|
777
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
580
|
|
|
|
|
|
|
} |
|
581
|
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
sub assert_Hand ($) { |
|
583
|
10
|
0
|
|
10
|
0
|
68
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Hand]) }) ? $_[0] : Hand->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
53
|
|
|
|
10
|
|
|
|
|
2273
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
584
|
|
|
|
|
|
|
} |
|
585
|
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
$EXPORT_TAGS{"Hand"} = [ qw( Hand is_Hand assert_Hand ) ]; |
|
587
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Hand"} }; |
|
588
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Hand"; |
|
589
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Hand"; |
|
590
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Hand"; |
|
591
|
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
} |
|
593
|
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
# HasMethods |
|
595
|
|
|
|
|
|
|
{ |
|
596
|
|
|
|
|
|
|
my $type; |
|
597
|
|
|
|
|
|
|
sub HasMethods () { |
|
598
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_HasMethods, name => "HasMethods", library => "Types::Standard", library_name => "HasMethods" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
599
|
|
|
|
|
|
|
} |
|
600
|
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
sub is_HasMethods ($) { |
|
602
|
10
|
|
|
10
|
0
|
84
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
10
|
|
|
0
|
|
21
|
|
|
|
10
|
|
|
|
|
609
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
603
|
|
|
|
|
|
|
} |
|
604
|
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
sub assert_HasMethods ($) { |
|
606
|
10
|
0
|
|
10
|
0
|
67
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : HasMethods->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
17
|
|
|
|
10
|
|
|
|
|
3829
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
607
|
|
|
|
|
|
|
} |
|
608
|
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
$EXPORT_TAGS{"HasMethods"} = [ qw( HasMethods is_HasMethods assert_HasMethods ) ]; |
|
610
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"HasMethods"} }; |
|
611
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "HasMethods"; |
|
612
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_HasMethods"; |
|
613
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_HasMethods"; |
|
614
|
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
} |
|
616
|
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
# HashRef |
|
618
|
|
|
|
|
|
|
{ |
|
619
|
|
|
|
|
|
|
my $type; |
|
620
|
|
|
|
|
|
|
sub HashRef () { |
|
621
|
3
|
|
50
|
3
|
1
|
37
|
$type ||= bless( { check => \&is_HashRef, name => "HashRef", library => "Types::Standard", library_name => "HashRef" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
622
|
|
|
|
|
|
|
} |
|
623
|
|
|
|
|
|
|
|
|
624
|
|
|
|
|
|
|
sub is_HashRef ($) { |
|
625
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') |
|
626
|
|
|
|
|
|
|
} |
|
627
|
|
|
|
|
|
|
|
|
628
|
|
|
|
|
|
|
sub assert_HashRef ($) { |
|
629
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') ? $_[0] : HashRef->get_message( $_[0] ); |
|
630
|
|
|
|
|
|
|
} |
|
631
|
|
|
|
|
|
|
|
|
632
|
|
|
|
|
|
|
$EXPORT_TAGS{"HashRef"} = [ qw( HashRef is_HashRef assert_HashRef ) ]; |
|
633
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"HashRef"} }; |
|
634
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "HashRef"; |
|
635
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_HashRef"; |
|
636
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_HashRef"; |
|
637
|
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
} |
|
639
|
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
# InstanceOf |
|
641
|
|
|
|
|
|
|
{ |
|
642
|
|
|
|
|
|
|
my $type; |
|
643
|
|
|
|
|
|
|
sub InstanceOf () { |
|
644
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_InstanceOf, name => "InstanceOf", library => "Types::Standard", library_name => "InstanceOf" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
645
|
|
|
|
|
|
|
} |
|
646
|
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
sub is_InstanceOf ($) { |
|
648
|
10
|
|
|
10
|
0
|
70
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
10
|
|
|
0
|
|
22
|
|
|
|
10
|
|
|
|
|
557
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
649
|
|
|
|
|
|
|
} |
|
650
|
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
sub assert_InstanceOf ($) { |
|
652
|
10
|
0
|
|
10
|
0
|
82
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : InstanceOf->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
21
|
|
|
|
10
|
|
|
|
|
9681
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
653
|
|
|
|
|
|
|
} |
|
654
|
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
$EXPORT_TAGS{"InstanceOf"} = [ qw( InstanceOf is_InstanceOf assert_InstanceOf ) ]; |
|
656
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"InstanceOf"} }; |
|
657
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "InstanceOf"; |
|
658
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_InstanceOf"; |
|
659
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_InstanceOf"; |
|
660
|
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
} |
|
662
|
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
# Int |
|
664
|
|
|
|
|
|
|
{ |
|
665
|
|
|
|
|
|
|
my $type; |
|
666
|
|
|
|
|
|
|
sub Int () { |
|
667
|
8
|
|
100
|
8
|
1
|
76
|
$type ||= bless( { check => \&is_Int, name => "Int", library => "Types::Standard", library_name => "Int" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
668
|
|
|
|
|
|
|
} |
|
669
|
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
sub is_Int ($) { |
|
671
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
672
|
|
|
|
|
|
|
} |
|
673
|
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
sub assert_Int ($) { |
|
675
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) ? $_[0] : Int->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
676
|
|
|
|
|
|
|
} |
|
677
|
|
|
|
|
|
|
|
|
678
|
|
|
|
|
|
|
$EXPORT_TAGS{"Int"} = [ qw( Int is_Int assert_Int ) ]; |
|
679
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Int"} }; |
|
680
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Int"; |
|
681
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Int"; |
|
682
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Int"; |
|
683
|
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
} |
|
685
|
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
# IntRange |
|
687
|
|
|
|
|
|
|
{ |
|
688
|
|
|
|
|
|
|
my $type; |
|
689
|
|
|
|
|
|
|
sub IntRange () { |
|
690
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_IntRange, name => "IntRange", library => "Types::Common::Numeric", library_name => "IntRange" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
691
|
|
|
|
|
|
|
} |
|
692
|
|
|
|
|
|
|
|
|
693
|
|
|
|
|
|
|
sub is_IntRange ($) { |
|
694
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
695
|
|
|
|
|
|
|
} |
|
696
|
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
sub assert_IntRange ($) { |
|
698
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) ? $_[0] : IntRange->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
699
|
|
|
|
|
|
|
} |
|
700
|
|
|
|
|
|
|
|
|
701
|
|
|
|
|
|
|
$EXPORT_TAGS{"IntRange"} = [ qw( IntRange is_IntRange assert_IntRange ) ]; |
|
702
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"IntRange"} }; |
|
703
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "IntRange"; |
|
704
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_IntRange"; |
|
705
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_IntRange"; |
|
706
|
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
} |
|
708
|
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
# Item |
|
710
|
|
|
|
|
|
|
{ |
|
711
|
|
|
|
|
|
|
my $type; |
|
712
|
|
|
|
|
|
|
sub Item () { |
|
713
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Item, name => "Item", library => "Types::Standard", library_name => "Item" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
714
|
|
|
|
|
|
|
} |
|
715
|
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
sub is_Item ($) { |
|
717
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
718
|
|
|
|
|
|
|
} |
|
719
|
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
sub assert_Item ($) { |
|
721
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Item->get_message( $_[0] ); |
|
722
|
|
|
|
|
|
|
} |
|
723
|
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
$EXPORT_TAGS{"Item"} = [ qw( Item is_Item assert_Item ) ]; |
|
725
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Item"} }; |
|
726
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Item"; |
|
727
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Item"; |
|
728
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Item"; |
|
729
|
|
|
|
|
|
|
|
|
730
|
|
|
|
|
|
|
} |
|
731
|
|
|
|
|
|
|
|
|
732
|
|
|
|
|
|
|
# JokerCard |
|
733
|
|
|
|
|
|
|
{ |
|
734
|
|
|
|
|
|
|
my $type; |
|
735
|
|
|
|
|
|
|
sub JokerCard () { |
|
736
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_JokerCard, name => "JokerCard", library => "Acme::Mitey::Cards::Types::Source", library_name => "JokerCard" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
737
|
|
|
|
|
|
|
} |
|
738
|
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
sub is_JokerCard ($) { |
|
740
|
10
|
0
|
|
10
|
0
|
113
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Joker]) }) |
|
|
10
|
|
|
0
|
|
32
|
|
|
|
10
|
|
|
|
|
715
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
741
|
|
|
|
|
|
|
} |
|
742
|
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
sub assert_JokerCard ($) { |
|
744
|
10
|
0
|
|
10
|
0
|
65
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Joker]) }) ? $_[0] : JokerCard->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
20
|
|
|
|
10
|
|
|
|
|
2305
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
745
|
|
|
|
|
|
|
} |
|
746
|
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
$EXPORT_TAGS{"JokerCard"} = [ qw( JokerCard is_JokerCard assert_JokerCard ) ]; |
|
748
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"JokerCard"} }; |
|
749
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "JokerCard"; |
|
750
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_JokerCard"; |
|
751
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_JokerCard"; |
|
752
|
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
} |
|
754
|
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
# LaxNum |
|
756
|
|
|
|
|
|
|
{ |
|
757
|
|
|
|
|
|
|
my $type; |
|
758
|
|
|
|
|
|
|
sub LaxNum () { |
|
759
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_LaxNum, name => "LaxNum", library => "Types::Standard", library_name => "LaxNum" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
760
|
|
|
|
|
|
|
} |
|
761
|
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
sub is_LaxNum ($) { |
|
763
|
10
|
0
|
0
|
10
|
0
|
84
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
|
10
|
|
|
0
|
|
28
|
|
|
|
10
|
|
|
|
|
794
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
764
|
|
|
|
|
|
|
} |
|
765
|
|
|
|
|
|
|
|
|
766
|
|
|
|
|
|
|
sub assert_LaxNum ($) { |
|
767
|
10
|
0
|
0
|
10
|
0
|
61
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) ? $_[0] : LaxNum->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
27
|
|
|
|
10
|
|
|
|
|
3305
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
768
|
|
|
|
|
|
|
} |
|
769
|
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
$EXPORT_TAGS{"LaxNum"} = [ qw( LaxNum is_LaxNum assert_LaxNum ) ]; |
|
771
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"LaxNum"} }; |
|
772
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "LaxNum"; |
|
773
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_LaxNum"; |
|
774
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_LaxNum"; |
|
775
|
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
} |
|
777
|
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
# LowerCaseSimpleStr |
|
779
|
|
|
|
|
|
|
{ |
|
780
|
|
|
|
|
|
|
my $type; |
|
781
|
|
|
|
|
|
|
sub LowerCaseSimpleStr () { |
|
782
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_LowerCaseSimpleStr, name => "LowerCaseSimpleStr", library => "Types::Common::String", library_name => "LowerCaseSimpleStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
783
|
|
|
|
|
|
|
} |
|
784
|
|
|
|
|
|
|
|
|
785
|
|
|
|
|
|
|
sub is_LowerCaseSimpleStr ($) { |
|
786
|
10
|
0
|
0
|
10
|
0
|
6341
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) |
|
|
10
|
0
|
|
0
|
|
153
|
|
|
|
10
|
0
|
|
|
|
157
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
787
|
|
|
|
|
|
|
} |
|
788
|
|
|
|
|
|
|
|
|
789
|
|
|
|
|
|
|
sub assert_LowerCaseSimpleStr ($) { |
|
790
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) ? $_[0] : LowerCaseSimpleStr->get_message( $_[0] ); |
|
791
|
|
|
|
|
|
|
} |
|
792
|
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
$EXPORT_TAGS{"LowerCaseSimpleStr"} = [ qw( LowerCaseSimpleStr is_LowerCaseSimpleStr assert_LowerCaseSimpleStr ) ]; |
|
794
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"LowerCaseSimpleStr"} }; |
|
795
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "LowerCaseSimpleStr"; |
|
796
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_LowerCaseSimpleStr"; |
|
797
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_LowerCaseSimpleStr"; |
|
798
|
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
} |
|
800
|
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
# LowerCaseStr |
|
802
|
|
|
|
|
|
|
{ |
|
803
|
|
|
|
|
|
|
my $type; |
|
804
|
|
|
|
|
|
|
sub LowerCaseStr () { |
|
805
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_LowerCaseStr, name => "LowerCaseStr", library => "Types::Common::String", library_name => "LowerCaseStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
806
|
|
|
|
|
|
|
} |
|
807
|
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
sub is_LowerCaseStr ($) { |
|
809
|
0
|
0
|
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
810
|
|
|
|
|
|
|
} |
|
811
|
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
sub assert_LowerCaseStr ($) { |
|
813
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Upper}/ms }) ? $_[0] : LowerCaseStr->get_message( $_[0] ); |
|
814
|
|
|
|
|
|
|
} |
|
815
|
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
$EXPORT_TAGS{"LowerCaseStr"} = [ qw( LowerCaseStr is_LowerCaseStr assert_LowerCaseStr ) ]; |
|
817
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"LowerCaseStr"} }; |
|
818
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "LowerCaseStr"; |
|
819
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_LowerCaseStr"; |
|
820
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_LowerCaseStr"; |
|
821
|
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
} |
|
823
|
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
# Map |
|
825
|
|
|
|
|
|
|
{ |
|
826
|
|
|
|
|
|
|
my $type; |
|
827
|
|
|
|
|
|
|
sub Map () { |
|
828
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Map, name => "Map", library => "Types::Standard", library_name => "Map" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
829
|
|
|
|
|
|
|
} |
|
830
|
|
|
|
|
|
|
|
|
831
|
|
|
|
|
|
|
sub is_Map ($) { |
|
832
|
0
|
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') |
|
833
|
|
|
|
|
|
|
} |
|
834
|
|
|
|
|
|
|
|
|
835
|
|
|
|
|
|
|
sub assert_Map ($) { |
|
836
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'HASH') ? $_[0] : Map->get_message( $_[0] ); |
|
837
|
|
|
|
|
|
|
} |
|
838
|
|
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
$EXPORT_TAGS{"Map"} = [ qw( Map is_Map assert_Map ) ]; |
|
840
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Map"} }; |
|
841
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Map"; |
|
842
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Map"; |
|
843
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Map"; |
|
844
|
|
|
|
|
|
|
|
|
845
|
|
|
|
|
|
|
} |
|
846
|
|
|
|
|
|
|
|
|
847
|
|
|
|
|
|
|
# Maybe |
|
848
|
|
|
|
|
|
|
{ |
|
849
|
|
|
|
|
|
|
my $type; |
|
850
|
|
|
|
|
|
|
sub Maybe () { |
|
851
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Maybe, name => "Maybe", library => "Types::Standard", library_name => "Maybe" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
852
|
|
|
|
|
|
|
} |
|
853
|
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
sub is_Maybe ($) { |
|
855
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
856
|
|
|
|
|
|
|
} |
|
857
|
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
sub assert_Maybe ($) { |
|
859
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Maybe->get_message( $_[0] ); |
|
860
|
|
|
|
|
|
|
} |
|
861
|
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
$EXPORT_TAGS{"Maybe"} = [ qw( Maybe is_Maybe assert_Maybe ) ]; |
|
863
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Maybe"} }; |
|
864
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Maybe"; |
|
865
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Maybe"; |
|
866
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Maybe"; |
|
867
|
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
} |
|
869
|
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
# NegativeInt |
|
871
|
|
|
|
|
|
|
{ |
|
872
|
|
|
|
|
|
|
my $type; |
|
873
|
|
|
|
|
|
|
sub NegativeInt () { |
|
874
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NegativeInt, name => "NegativeInt", library => "Types::Common::Numeric", library_name => "NegativeInt" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
875
|
|
|
|
|
|
|
} |
|
876
|
|
|
|
|
|
|
|
|
877
|
|
|
|
|
|
|
sub is_NegativeInt ($) { |
|
878
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] < 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
879
|
|
|
|
|
|
|
} |
|
880
|
|
|
|
|
|
|
|
|
881
|
|
|
|
|
|
|
sub assert_NegativeInt ($) { |
|
882
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] < 0)) ? $_[0] : NegativeInt->get_message( $_[0] ); |
|
883
|
|
|
|
|
|
|
} |
|
884
|
|
|
|
|
|
|
|
|
885
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeInt"} = [ qw( NegativeInt is_NegativeInt assert_NegativeInt ) ]; |
|
886
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeInt"} }; |
|
887
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeInt"; |
|
888
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeInt"; |
|
889
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeInt"; |
|
890
|
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
} |
|
892
|
|
|
|
|
|
|
|
|
893
|
|
|
|
|
|
|
# NegativeNum |
|
894
|
|
|
|
|
|
|
{ |
|
895
|
|
|
|
|
|
|
my $type; |
|
896
|
|
|
|
|
|
|
sub NegativeNum () { |
|
897
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NegativeNum, name => "NegativeNum", library => "Types::Common::Numeric", library_name => "NegativeNum" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
898
|
|
|
|
|
|
|
} |
|
899
|
|
|
|
|
|
|
|
|
900
|
|
|
|
|
|
|
sub is_NegativeNum ($) { |
|
901
|
10
|
0
|
0
|
10
|
0
|
225502
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] < 0)) |
|
|
10
|
0
|
|
0
|
|
22
|
|
|
|
10
|
|
|
|
|
700
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
902
|
|
|
|
|
|
|
} |
|
903
|
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
sub assert_NegativeNum ($) { |
|
905
|
10
|
0
|
0
|
10
|
0
|
61
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] < 0)) ? $_[0] : NegativeNum->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
21
|
|
|
|
10
|
|
|
|
|
4244
|
|
|
|
0
|
|
|
|
|
0
|
|
|
906
|
|
|
|
|
|
|
} |
|
907
|
|
|
|
|
|
|
|
|
908
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeNum"} = [ qw( NegativeNum is_NegativeNum assert_NegativeNum ) ]; |
|
909
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeNum"} }; |
|
910
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeNum"; |
|
911
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeNum"; |
|
912
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeNum"; |
|
913
|
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
} |
|
915
|
|
|
|
|
|
|
|
|
916
|
|
|
|
|
|
|
# NegativeOrZeroInt |
|
917
|
|
|
|
|
|
|
{ |
|
918
|
|
|
|
|
|
|
my $type; |
|
919
|
|
|
|
|
|
|
sub NegativeOrZeroInt () { |
|
920
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NegativeOrZeroInt, name => "NegativeOrZeroInt", library => "Types::Common::Numeric", library_name => "NegativeOrZeroInt" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
921
|
|
|
|
|
|
|
} |
|
922
|
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
sub is_NegativeOrZeroInt ($) { |
|
924
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] <= 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
925
|
|
|
|
|
|
|
} |
|
926
|
|
|
|
|
|
|
|
|
927
|
|
|
|
|
|
|
sub assert_NegativeOrZeroInt ($) { |
|
928
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] <= 0)) ? $_[0] : NegativeOrZeroInt->get_message( $_[0] ); |
|
929
|
|
|
|
|
|
|
} |
|
930
|
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeOrZeroInt"} = [ qw( NegativeOrZeroInt is_NegativeOrZeroInt assert_NegativeOrZeroInt ) ]; |
|
932
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeOrZeroInt"} }; |
|
933
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeOrZeroInt"; |
|
934
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeOrZeroInt"; |
|
935
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeOrZeroInt"; |
|
936
|
|
|
|
|
|
|
|
|
937
|
|
|
|
|
|
|
} |
|
938
|
|
|
|
|
|
|
|
|
939
|
|
|
|
|
|
|
# NegativeOrZeroNum |
|
940
|
|
|
|
|
|
|
{ |
|
941
|
|
|
|
|
|
|
my $type; |
|
942
|
|
|
|
|
|
|
sub NegativeOrZeroNum () { |
|
943
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NegativeOrZeroNum, name => "NegativeOrZeroNum", library => "Types::Common::Numeric", library_name => "NegativeOrZeroNum" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
944
|
|
|
|
|
|
|
} |
|
945
|
|
|
|
|
|
|
|
|
946
|
|
|
|
|
|
|
sub is_NegativeOrZeroNum ($) { |
|
947
|
10
|
0
|
0
|
10
|
0
|
75
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] <= 0)) |
|
|
10
|
0
|
|
0
|
|
24
|
|
|
|
10
|
|
|
|
|
652
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
948
|
|
|
|
|
|
|
} |
|
949
|
|
|
|
|
|
|
|
|
950
|
|
|
|
|
|
|
sub assert_NegativeOrZeroNum ($) { |
|
951
|
10
|
0
|
0
|
10
|
0
|
58
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] <= 0)) ? $_[0] : NegativeOrZeroNum->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
28
|
|
|
|
10
|
|
|
|
|
7075
|
|
|
|
0
|
|
|
|
|
0
|
|
|
952
|
|
|
|
|
|
|
} |
|
953
|
|
|
|
|
|
|
|
|
954
|
|
|
|
|
|
|
$EXPORT_TAGS{"NegativeOrZeroNum"} = [ qw( NegativeOrZeroNum is_NegativeOrZeroNum assert_NegativeOrZeroNum ) ]; |
|
955
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NegativeOrZeroNum"} }; |
|
956
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NegativeOrZeroNum"; |
|
957
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NegativeOrZeroNum"; |
|
958
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NegativeOrZeroNum"; |
|
959
|
|
|
|
|
|
|
|
|
960
|
|
|
|
|
|
|
} |
|
961
|
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
# NonEmptySimpleStr |
|
963
|
|
|
|
|
|
|
{ |
|
964
|
|
|
|
|
|
|
my $type; |
|
965
|
|
|
|
|
|
|
sub NonEmptySimpleStr () { |
|
966
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NonEmptySimpleStr, name => "NonEmptySimpleStr", library => "Types::Common::String", library_name => "NonEmptySimpleStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
967
|
|
|
|
|
|
|
} |
|
968
|
|
|
|
|
|
|
|
|
969
|
|
|
|
|
|
|
sub is_NonEmptySimpleStr ($) { |
|
970
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
971
|
|
|
|
|
|
|
} |
|
972
|
|
|
|
|
|
|
|
|
973
|
|
|
|
|
|
|
sub assert_NonEmptySimpleStr ($) { |
|
974
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) ? $_[0] : NonEmptySimpleStr->get_message( $_[0] ); |
|
975
|
|
|
|
|
|
|
} |
|
976
|
|
|
|
|
|
|
|
|
977
|
|
|
|
|
|
|
$EXPORT_TAGS{"NonEmptySimpleStr"} = [ qw( NonEmptySimpleStr is_NonEmptySimpleStr assert_NonEmptySimpleStr ) ]; |
|
978
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NonEmptySimpleStr"} }; |
|
979
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NonEmptySimpleStr"; |
|
980
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NonEmptySimpleStr"; |
|
981
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NonEmptySimpleStr"; |
|
982
|
|
|
|
|
|
|
|
|
983
|
|
|
|
|
|
|
} |
|
984
|
|
|
|
|
|
|
|
|
985
|
|
|
|
|
|
|
# NonEmptyStr |
|
986
|
|
|
|
|
|
|
{ |
|
987
|
|
|
|
|
|
|
my $type; |
|
988
|
|
|
|
|
|
|
sub NonEmptyStr () { |
|
989
|
9
|
|
100
|
9
|
1
|
208
|
$type ||= bless( { check => \&is_NonEmptyStr, name => "NonEmptyStr", library => "Types::Common::String", library_name => "NonEmptyStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
990
|
|
|
|
|
|
|
} |
|
991
|
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
sub is_NonEmptyStr ($) { |
|
993
|
0
|
0
|
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
994
|
|
|
|
|
|
|
} |
|
995
|
|
|
|
|
|
|
|
|
996
|
|
|
|
|
|
|
sub assert_NonEmptyStr ($) { |
|
997
|
0
|
0
|
0
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) ? $_[0] : NonEmptyStr->get_message( $_[0] ); |
|
998
|
|
|
|
|
|
|
} |
|
999
|
|
|
|
|
|
|
|
|
1000
|
|
|
|
|
|
|
$EXPORT_TAGS{"NonEmptyStr"} = [ qw( NonEmptyStr is_NonEmptyStr assert_NonEmptyStr ) ]; |
|
1001
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NonEmptyStr"} }; |
|
1002
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NonEmptyStr"; |
|
1003
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NonEmptyStr"; |
|
1004
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NonEmptyStr"; |
|
1005
|
|
|
|
|
|
|
|
|
1006
|
|
|
|
|
|
|
} |
|
1007
|
|
|
|
|
|
|
|
|
1008
|
|
|
|
|
|
|
# Num |
|
1009
|
|
|
|
|
|
|
{ |
|
1010
|
|
|
|
|
|
|
my $type; |
|
1011
|
|
|
|
|
|
|
sub Num () { |
|
1012
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Num, name => "Num", library => "Types::Standard", library_name => "Num" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1013
|
|
|
|
|
|
|
} |
|
1014
|
|
|
|
|
|
|
|
|
1015
|
|
|
|
|
|
|
sub is_Num ($) { |
|
1016
|
10
|
0
|
0
|
10
|
0
|
77
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
|
10
|
|
|
0
|
|
26
|
|
|
|
10
|
|
|
|
|
680
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1017
|
|
|
|
|
|
|
} |
|
1018
|
|
|
|
|
|
|
|
|
1019
|
|
|
|
|
|
|
sub assert_Num ($) { |
|
1020
|
10
|
0
|
0
|
10
|
0
|
61
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) ? $_[0] : Num->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
25
|
|
|
|
10
|
|
|
|
|
1846
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1021
|
|
|
|
|
|
|
} |
|
1022
|
|
|
|
|
|
|
|
|
1023
|
|
|
|
|
|
|
$EXPORT_TAGS{"Num"} = [ qw( Num is_Num assert_Num ) ]; |
|
1024
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Num"} }; |
|
1025
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Num"; |
|
1026
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Num"; |
|
1027
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Num"; |
|
1028
|
|
|
|
|
|
|
|
|
1029
|
|
|
|
|
|
|
} |
|
1030
|
|
|
|
|
|
|
|
|
1031
|
|
|
|
|
|
|
# NumRange |
|
1032
|
|
|
|
|
|
|
{ |
|
1033
|
|
|
|
|
|
|
my $type; |
|
1034
|
|
|
|
|
|
|
sub NumRange () { |
|
1035
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NumRange, name => "NumRange", library => "Types::Common::Numeric", library_name => "NumRange" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1036
|
|
|
|
|
|
|
} |
|
1037
|
|
|
|
|
|
|
|
|
1038
|
|
|
|
|
|
|
sub is_NumRange ($) { |
|
1039
|
10
|
0
|
0
|
10
|
0
|
65
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
|
10
|
|
|
0
|
|
22
|
|
|
|
10
|
|
|
|
|
562
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1040
|
|
|
|
|
|
|
} |
|
1041
|
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
sub assert_NumRange ($) { |
|
1043
|
10
|
0
|
0
|
10
|
0
|
55
|
(do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) ? $_[0] : NumRange->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
18
|
|
|
|
10
|
|
|
|
|
1668
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1044
|
|
|
|
|
|
|
} |
|
1045
|
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
$EXPORT_TAGS{"NumRange"} = [ qw( NumRange is_NumRange assert_NumRange ) ]; |
|
1047
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NumRange"} }; |
|
1048
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NumRange"; |
|
1049
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NumRange"; |
|
1050
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NumRange"; |
|
1051
|
|
|
|
|
|
|
|
|
1052
|
|
|
|
|
|
|
} |
|
1053
|
|
|
|
|
|
|
|
|
1054
|
|
|
|
|
|
|
# NumericCard |
|
1055
|
|
|
|
|
|
|
{ |
|
1056
|
|
|
|
|
|
|
my $type; |
|
1057
|
|
|
|
|
|
|
sub NumericCard () { |
|
1058
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NumericCard, name => "NumericCard", library => "Acme::Mitey::Cards::Types::Source", library_name => "NumericCard" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1059
|
|
|
|
|
|
|
} |
|
1060
|
|
|
|
|
|
|
|
|
1061
|
|
|
|
|
|
|
sub is_NumericCard ($) { |
|
1062
|
10
|
0
|
|
10
|
0
|
59
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Numeric]) }) |
|
|
10
|
|
|
0
|
|
24
|
|
|
|
10
|
|
|
|
|
547
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1063
|
|
|
|
|
|
|
} |
|
1064
|
|
|
|
|
|
|
|
|
1065
|
|
|
|
|
|
|
sub assert_NumericCard ($) { |
|
1066
|
10
|
0
|
|
10
|
0
|
55
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Card::Numeric]) }) ? $_[0] : NumericCard->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
21
|
|
|
|
10
|
|
|
|
|
4975
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1067
|
|
|
|
|
|
|
} |
|
1068
|
|
|
|
|
|
|
|
|
1069
|
|
|
|
|
|
|
$EXPORT_TAGS{"NumericCard"} = [ qw( NumericCard is_NumericCard assert_NumericCard ) ]; |
|
1070
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NumericCard"} }; |
|
1071
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NumericCard"; |
|
1072
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NumericCard"; |
|
1073
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NumericCard"; |
|
1074
|
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
} |
|
1076
|
|
|
|
|
|
|
|
|
1077
|
|
|
|
|
|
|
# NumericCode |
|
1078
|
|
|
|
|
|
|
{ |
|
1079
|
|
|
|
|
|
|
my $type; |
|
1080
|
|
|
|
|
|
|
sub NumericCode () { |
|
1081
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_NumericCode, name => "NumericCode", library => "Types::Common::String", library_name => "NumericCode" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1082
|
|
|
|
|
|
|
} |
|
1083
|
|
|
|
|
|
|
|
|
1084
|
|
|
|
|
|
|
sub is_NumericCode ($) { |
|
1085
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && ($_[0] =~ m/^[0-9]+$/)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1086
|
|
|
|
|
|
|
} |
|
1087
|
|
|
|
|
|
|
|
|
1088
|
|
|
|
|
|
|
sub assert_NumericCode ($) { |
|
1089
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && ($_[0] =~ m/^[0-9]+$/)) ? $_[0] : NumericCode->get_message( $_[0] ); |
|
1090
|
|
|
|
|
|
|
} |
|
1091
|
|
|
|
|
|
|
|
|
1092
|
|
|
|
|
|
|
$EXPORT_TAGS{"NumericCode"} = [ qw( NumericCode is_NumericCode assert_NumericCode ) ]; |
|
1093
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"NumericCode"} }; |
|
1094
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "NumericCode"; |
|
1095
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_NumericCode"; |
|
1096
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_NumericCode"; |
|
1097
|
|
|
|
|
|
|
|
|
1098
|
|
|
|
|
|
|
} |
|
1099
|
|
|
|
|
|
|
|
|
1100
|
|
|
|
|
|
|
# Object |
|
1101
|
|
|
|
|
|
|
{ |
|
1102
|
|
|
|
|
|
|
my $type; |
|
1103
|
|
|
|
|
|
|
sub Object () { |
|
1104
|
4
|
|
50
|
4
|
1
|
59
|
$type ||= bless( { check => \&is_Object, name => "Object", library => "Types::Standard", library_name => "Object" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1105
|
|
|
|
|
|
|
} |
|
1106
|
|
|
|
|
|
|
|
|
1107
|
|
|
|
|
|
|
sub is_Object ($) { |
|
1108
|
10
|
|
|
10
|
0
|
71
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) |
|
|
10
|
|
|
0
|
|
21
|
|
|
|
10
|
|
|
|
|
427
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1109
|
|
|
|
|
|
|
} |
|
1110
|
|
|
|
|
|
|
|
|
1111
|
|
|
|
|
|
|
sub assert_Object ($) { |
|
1112
|
10
|
0
|
|
10
|
0
|
54
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) }) ? $_[0] : Object->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
22
|
|
|
|
10
|
|
|
|
|
1921
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1113
|
|
|
|
|
|
|
} |
|
1114
|
|
|
|
|
|
|
|
|
1115
|
|
|
|
|
|
|
$EXPORT_TAGS{"Object"} = [ qw( Object is_Object assert_Object ) ]; |
|
1116
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Object"} }; |
|
1117
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Object"; |
|
1118
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Object"; |
|
1119
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Object"; |
|
1120
|
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
} |
|
1122
|
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
# OptList |
|
1124
|
|
|
|
|
|
|
{ |
|
1125
|
|
|
|
|
|
|
my $type; |
|
1126
|
|
|
|
|
|
|
sub OptList () { |
|
1127
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_OptList, name => "OptList", library => "Types::Standard", library_name => "OptList" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1128
|
|
|
|
|
|
|
} |
|
1129
|
|
|
|
|
|
|
|
|
1130
|
|
|
|
|
|
|
sub is_OptList ($) { |
|
1131
|
10
|
0
|
0
|
10
|
0
|
66
|
(((ref($_[0]) eq 'ARRAY')) && (do { my $ok = 1; for my $inner (@{$_[0]}) { no warnings; ($ok=0) && last unless ref($inner) eq q(ARRAY) && @$inner == 2 && (do { defined($inner->[0]) and do { ref(\$inner->[0]) eq 'SCALAR' or ref(\(my $val = $inner->[0])) eq 'SCALAR' } }); } $ok })) |
|
|
10
|
0
|
0
|
0
|
|
20
|
|
|
|
10
|
0
|
0
|
|
|
1559
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1132
|
|
|
|
|
|
|
} |
|
1133
|
|
|
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
sub assert_OptList ($) { |
|
1135
|
10
|
0
|
0
|
10
|
0
|
64
|
(((ref($_[0]) eq 'ARRAY')) && (do { my $ok = 1; for my $inner (@{$_[0]}) { no warnings; ($ok=0) && last unless ref($inner) eq q(ARRAY) && @$inner == 2 && (do { defined($inner->[0]) and do { ref(\$inner->[0]) eq 'SCALAR' or ref(\(my $val = $inner->[0])) eq 'SCALAR' } }); } $ok })) ? $_[0] : OptList->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
23
|
|
|
|
10
|
|
|
|
|
3932
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1136
|
|
|
|
|
|
|
} |
|
1137
|
|
|
|
|
|
|
|
|
1138
|
|
|
|
|
|
|
$EXPORT_TAGS{"OptList"} = [ qw( OptList is_OptList assert_OptList ) ]; |
|
1139
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"OptList"} }; |
|
1140
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "OptList"; |
|
1141
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_OptList"; |
|
1142
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_OptList"; |
|
1143
|
|
|
|
|
|
|
|
|
1144
|
|
|
|
|
|
|
} |
|
1145
|
|
|
|
|
|
|
|
|
1146
|
|
|
|
|
|
|
# Optional |
|
1147
|
|
|
|
|
|
|
{ |
|
1148
|
|
|
|
|
|
|
my $type; |
|
1149
|
|
|
|
|
|
|
sub Optional () { |
|
1150
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Optional, name => "Optional", library => "Types::Standard", library_name => "Optional" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1151
|
|
|
|
|
|
|
} |
|
1152
|
|
|
|
|
|
|
|
|
1153
|
|
|
|
|
|
|
sub is_Optional ($) { |
|
1154
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
1155
|
|
|
|
|
|
|
} |
|
1156
|
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
sub assert_Optional ($) { |
|
1158
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Optional->get_message( $_[0] ); |
|
1159
|
|
|
|
|
|
|
} |
|
1160
|
|
|
|
|
|
|
|
|
1161
|
|
|
|
|
|
|
$EXPORT_TAGS{"Optional"} = [ qw( Optional is_Optional assert_Optional ) ]; |
|
1162
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Optional"} }; |
|
1163
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Optional"; |
|
1164
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Optional"; |
|
1165
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Optional"; |
|
1166
|
|
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
|
} |
|
1168
|
|
|
|
|
|
|
|
|
1169
|
|
|
|
|
|
|
# Overload |
|
1170
|
|
|
|
|
|
|
{ |
|
1171
|
|
|
|
|
|
|
my $type; |
|
1172
|
|
|
|
|
|
|
sub Overload () { |
|
1173
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Overload, name => "Overload", library => "Types::Standard", library_name => "Overload" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1174
|
|
|
|
|
|
|
} |
|
1175
|
|
|
|
|
|
|
|
|
1176
|
|
|
|
|
|
|
sub is_Overload ($) { |
|
1177
|
10
|
0
|
|
10
|
0
|
69
|
(do { use Scalar::Util (); use overload (); Scalar::Util::blessed($_[0]) and overload::Overloaded($_[0]) }) |
|
|
10
|
|
|
10
|
|
20
|
|
|
|
10
|
|
|
0
|
|
148
|
|
|
|
10
|
|
|
|
|
47
|
|
|
|
10
|
|
|
|
|
18
|
|
|
|
10
|
|
|
|
|
552
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1178
|
|
|
|
|
|
|
} |
|
1179
|
|
|
|
|
|
|
|
|
1180
|
|
|
|
|
|
|
sub assert_Overload ($) { |
|
1181
|
10
|
0
|
|
10
|
0
|
51
|
(do { use Scalar::Util (); use overload (); Scalar::Util::blessed($_[0]) and overload::Overloaded($_[0]) }) ? $_[0] : Overload->get_message( $_[0] ); |
|
|
10
|
0
|
|
10
|
|
20
|
|
|
|
10
|
|
|
0
|
|
131
|
|
|
|
10
|
|
|
|
|
43
|
|
|
|
10
|
|
|
|
|
20
|
|
|
|
10
|
|
|
|
|
7488
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1182
|
|
|
|
|
|
|
} |
|
1183
|
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
$EXPORT_TAGS{"Overload"} = [ qw( Overload is_Overload assert_Overload ) ]; |
|
1185
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Overload"} }; |
|
1186
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Overload"; |
|
1187
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Overload"; |
|
1188
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Overload"; |
|
1189
|
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
} |
|
1191
|
|
|
|
|
|
|
|
|
1192
|
|
|
|
|
|
|
# Password |
|
1193
|
|
|
|
|
|
|
{ |
|
1194
|
|
|
|
|
|
|
my $type; |
|
1195
|
|
|
|
|
|
|
sub Password () { |
|
1196
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Password, name => "Password", library => "Types::Common::String", library_name => "Password" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1197
|
|
|
|
|
|
|
} |
|
1198
|
|
|
|
|
|
|
|
|
1199
|
|
|
|
|
|
|
sub is_Password ($) { |
|
1200
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 3)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1201
|
|
|
|
|
|
|
} |
|
1202
|
|
|
|
|
|
|
|
|
1203
|
|
|
|
|
|
|
sub assert_Password ($) { |
|
1204
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 3)) ? $_[0] : Password->get_message( $_[0] ); |
|
1205
|
|
|
|
|
|
|
} |
|
1206
|
|
|
|
|
|
|
|
|
1207
|
|
|
|
|
|
|
$EXPORT_TAGS{"Password"} = [ qw( Password is_Password assert_Password ) ]; |
|
1208
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Password"} }; |
|
1209
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Password"; |
|
1210
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Password"; |
|
1211
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Password"; |
|
1212
|
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
} |
|
1214
|
|
|
|
|
|
|
|
|
1215
|
|
|
|
|
|
|
# PositiveInt |
|
1216
|
|
|
|
|
|
|
{ |
|
1217
|
|
|
|
|
|
|
my $type; |
|
1218
|
|
|
|
|
|
|
sub PositiveInt () { |
|
1219
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_PositiveInt, name => "PositiveInt", library => "Types::Common::Numeric", library_name => "PositiveInt" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1220
|
|
|
|
|
|
|
} |
|
1221
|
|
|
|
|
|
|
|
|
1222
|
|
|
|
|
|
|
sub is_PositiveInt ($) { |
|
1223
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] > 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1224
|
|
|
|
|
|
|
} |
|
1225
|
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
sub assert_PositiveInt ($) { |
|
1227
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] > 0)) ? $_[0] : PositiveInt->get_message( $_[0] ); |
|
1228
|
|
|
|
|
|
|
} |
|
1229
|
|
|
|
|
|
|
|
|
1230
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveInt"} = [ qw( PositiveInt is_PositiveInt assert_PositiveInt ) ]; |
|
1231
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveInt"} }; |
|
1232
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveInt"; |
|
1233
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveInt"; |
|
1234
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveInt"; |
|
1235
|
|
|
|
|
|
|
|
|
1236
|
|
|
|
|
|
|
} |
|
1237
|
|
|
|
|
|
|
|
|
1238
|
|
|
|
|
|
|
# PositiveNum |
|
1239
|
|
|
|
|
|
|
{ |
|
1240
|
|
|
|
|
|
|
my $type; |
|
1241
|
|
|
|
|
|
|
sub PositiveNum () { |
|
1242
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_PositiveNum, name => "PositiveNum", library => "Types::Common::Numeric", library_name => "PositiveNum" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1243
|
|
|
|
|
|
|
} |
|
1244
|
|
|
|
|
|
|
|
|
1245
|
|
|
|
|
|
|
sub is_PositiveNum ($) { |
|
1246
|
10
|
0
|
0
|
10
|
0
|
78
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] > 0)) |
|
|
10
|
0
|
|
0
|
|
19
|
|
|
|
10
|
|
|
|
|
671
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1247
|
|
|
|
|
|
|
} |
|
1248
|
|
|
|
|
|
|
|
|
1249
|
|
|
|
|
|
|
sub assert_PositiveNum ($) { |
|
1250
|
10
|
0
|
0
|
10
|
0
|
53
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] > 0)) ? $_[0] : PositiveNum->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
18
|
|
|
|
10
|
|
|
|
|
4326
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1251
|
|
|
|
|
|
|
} |
|
1252
|
|
|
|
|
|
|
|
|
1253
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveNum"} = [ qw( PositiveNum is_PositiveNum assert_PositiveNum ) ]; |
|
1254
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveNum"} }; |
|
1255
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveNum"; |
|
1256
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveNum"; |
|
1257
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveNum"; |
|
1258
|
|
|
|
|
|
|
|
|
1259
|
|
|
|
|
|
|
} |
|
1260
|
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
# PositiveOrZeroInt |
|
1262
|
|
|
|
|
|
|
{ |
|
1263
|
|
|
|
|
|
|
my $type; |
|
1264
|
|
|
|
|
|
|
sub PositiveOrZeroInt () { |
|
1265
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_PositiveOrZeroInt, name => "PositiveOrZeroInt", library => "Types::Common::Numeric", library_name => "PositiveOrZeroInt" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1266
|
|
|
|
|
|
|
} |
|
1267
|
|
|
|
|
|
|
|
|
1268
|
|
|
|
|
|
|
sub is_PositiveOrZeroInt ($) { |
|
1269
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 0)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1270
|
|
|
|
|
|
|
} |
|
1271
|
|
|
|
|
|
|
|
|
1272
|
|
|
|
|
|
|
sub assert_PositiveOrZeroInt ($) { |
|
1273
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= 0)) ? $_[0] : PositiveOrZeroInt->get_message( $_[0] ); |
|
1274
|
|
|
|
|
|
|
} |
|
1275
|
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveOrZeroInt"} = [ qw( PositiveOrZeroInt is_PositiveOrZeroInt assert_PositiveOrZeroInt ) ]; |
|
1277
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveOrZeroInt"} }; |
|
1278
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveOrZeroInt"; |
|
1279
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveOrZeroInt"; |
|
1280
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveOrZeroInt"; |
|
1281
|
|
|
|
|
|
|
|
|
1282
|
|
|
|
|
|
|
} |
|
1283
|
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
# PositiveOrZeroNum |
|
1285
|
|
|
|
|
|
|
{ |
|
1286
|
|
|
|
|
|
|
my $type; |
|
1287
|
|
|
|
|
|
|
sub PositiveOrZeroNum () { |
|
1288
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_PositiveOrZeroNum, name => "PositiveOrZeroNum", library => "Types::Common::Numeric", library_name => "PositiveOrZeroNum" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1289
|
|
|
|
|
|
|
} |
|
1290
|
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
sub is_PositiveOrZeroNum ($) { |
|
1292
|
10
|
0
|
0
|
10
|
0
|
66
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] >= 0)) |
|
|
10
|
0
|
|
0
|
|
23
|
|
|
|
10
|
|
|
|
|
664
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1293
|
|
|
|
|
|
|
} |
|
1294
|
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
sub assert_PositiveOrZeroNum ($) { |
|
1296
|
10
|
0
|
0
|
10
|
0
|
52
|
(do { (do { use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) } && ($_[0] >= 0)) ? $_[0] : PositiveOrZeroNum->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
19
|
|
|
|
10
|
|
|
|
|
3488
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1297
|
|
|
|
|
|
|
} |
|
1298
|
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
$EXPORT_TAGS{"PositiveOrZeroNum"} = [ qw( PositiveOrZeroNum is_PositiveOrZeroNum assert_PositiveOrZeroNum ) ]; |
|
1300
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"PositiveOrZeroNum"} }; |
|
1301
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "PositiveOrZeroNum"; |
|
1302
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_PositiveOrZeroNum"; |
|
1303
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_PositiveOrZeroNum"; |
|
1304
|
|
|
|
|
|
|
|
|
1305
|
|
|
|
|
|
|
} |
|
1306
|
|
|
|
|
|
|
|
|
1307
|
|
|
|
|
|
|
# Ref |
|
1308
|
|
|
|
|
|
|
{ |
|
1309
|
|
|
|
|
|
|
my $type; |
|
1310
|
|
|
|
|
|
|
sub Ref () { |
|
1311
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Ref, name => "Ref", library => "Types::Standard", library_name => "Ref" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1312
|
|
|
|
|
|
|
} |
|
1313
|
|
|
|
|
|
|
|
|
1314
|
|
|
|
|
|
|
sub is_Ref ($) { |
|
1315
|
0
|
|
|
0
|
0
|
0
|
(!!ref($_[0])) |
|
1316
|
|
|
|
|
|
|
} |
|
1317
|
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
sub assert_Ref ($) { |
|
1319
|
0
|
0
|
|
0
|
0
|
0
|
(!!ref($_[0])) ? $_[0] : Ref->get_message( $_[0] ); |
|
1320
|
|
|
|
|
|
|
} |
|
1321
|
|
|
|
|
|
|
|
|
1322
|
|
|
|
|
|
|
$EXPORT_TAGS{"Ref"} = [ qw( Ref is_Ref assert_Ref ) ]; |
|
1323
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Ref"} }; |
|
1324
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Ref"; |
|
1325
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Ref"; |
|
1326
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Ref"; |
|
1327
|
|
|
|
|
|
|
|
|
1328
|
|
|
|
|
|
|
} |
|
1329
|
|
|
|
|
|
|
|
|
1330
|
|
|
|
|
|
|
# RegexpRef |
|
1331
|
|
|
|
|
|
|
{ |
|
1332
|
|
|
|
|
|
|
my $type; |
|
1333
|
|
|
|
|
|
|
sub RegexpRef () { |
|
1334
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_RegexpRef, name => "RegexpRef", library => "Types::Standard", library_name => "RegexpRef" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1335
|
|
|
|
|
|
|
} |
|
1336
|
|
|
|
|
|
|
|
|
1337
|
|
|
|
|
|
|
sub is_RegexpRef ($) { |
|
1338
|
10
|
0
|
0
|
10
|
0
|
64
|
(do { use Scalar::Util (); use re (); ref($_[0]) && !!re::is_regexp($_[0]) or Scalar::Util::blessed($_[0]) && $_[0]->isa('Regexp') }) |
|
|
10
|
|
0
|
10
|
|
19
|
|
|
|
10
|
|
|
0
|
|
142
|
|
|
|
10
|
|
|
|
|
51
|
|
|
|
10
|
|
|
|
|
22
|
|
|
|
10
|
|
|
|
|
715
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1339
|
|
|
|
|
|
|
} |
|
1340
|
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
sub assert_RegexpRef ($) { |
|
1342
|
10
|
0
|
0
|
10
|
0
|
52
|
(do { use Scalar::Util (); use re (); ref($_[0]) && !!re::is_regexp($_[0]) or Scalar::Util::blessed($_[0]) && $_[0]->isa('Regexp') }) ? $_[0] : RegexpRef->get_message( $_[0] ); |
|
|
10
|
0
|
0
|
10
|
|
19
|
|
|
|
10
|
|
|
0
|
|
136
|
|
|
|
10
|
|
|
|
|
41
|
|
|
|
10
|
|
|
|
|
20
|
|
|
|
10
|
|
|
|
|
2012
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1343
|
|
|
|
|
|
|
} |
|
1344
|
|
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
|
$EXPORT_TAGS{"RegexpRef"} = [ qw( RegexpRef is_RegexpRef assert_RegexpRef ) ]; |
|
1346
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"RegexpRef"} }; |
|
1347
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "RegexpRef"; |
|
1348
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_RegexpRef"; |
|
1349
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_RegexpRef"; |
|
1350
|
|
|
|
|
|
|
|
|
1351
|
|
|
|
|
|
|
} |
|
1352
|
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
# RoleName |
|
1354
|
|
|
|
|
|
|
{ |
|
1355
|
|
|
|
|
|
|
my $type; |
|
1356
|
|
|
|
|
|
|
sub RoleName () { |
|
1357
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_RoleName, name => "RoleName", library => "Types::Standard", library_name => "RoleName" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1358
|
|
|
|
|
|
|
} |
|
1359
|
|
|
|
|
|
|
|
|
1360
|
|
|
|
|
|
|
sub is_RoleName ($) { |
|
1361
|
0
|
|
|
0
|
0
|
0
|
do { (sub { |
|
1362
|
10
|
|
|
10
|
|
64
|
no strict 'refs'; |
|
|
10
|
|
|
|
|
21
|
|
|
|
10
|
|
|
|
|
2629
|
|
|
1363
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
1364
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
1365
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1366
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
1367
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1368
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
1369
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
1370
|
|
|
|
|
|
|
return !!1 |
|
1371
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
1372
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
1373
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
1374
|
|
|
|
|
|
|
} |
|
1375
|
0
|
|
|
|
|
0
|
return !!0; |
|
1376
|
0
|
0
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) and not $_[0]->can('new') } |
|
|
0
|
|
|
|
|
0
|
|
|
1377
|
|
|
|
|
|
|
} |
|
1378
|
|
|
|
|
|
|
|
|
1379
|
|
|
|
|
|
|
sub assert_RoleName ($) { |
|
1380
|
0
|
0
|
|
0
|
0
|
0
|
do { (sub { |
|
1381
|
10
|
|
|
10
|
|
66
|
no strict 'refs'; |
|
|
10
|
|
|
|
|
24
|
|
|
|
10
|
|
|
|
|
5911
|
|
|
1382
|
0
|
0
|
|
0
|
|
0
|
return !!0 if ref $_[0]; |
|
1383
|
0
|
0
|
|
|
|
0
|
return !!0 if not $_[0]; |
|
1384
|
0
|
0
|
|
|
|
0
|
return !!0 if ref(do { my $tmpstr = $_[0]; \$tmpstr }) ne 'SCALAR'; |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1385
|
0
|
|
|
|
|
0
|
my $stash = \%{"$_[0]\::"}; |
|
|
0
|
|
|
|
|
0
|
|
|
1386
|
0
|
0
|
0
|
|
|
0
|
return !!1 if exists($stash->{'ISA'}) && *{$stash->{'ISA'}}{ARRAY} && @{$_[0].'::ISA'}; |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1387
|
0
|
0
|
|
|
|
0
|
return !!1 if exists($stash->{'VERSION'}); |
|
1388
|
0
|
|
|
|
|
0
|
foreach my $globref (values %$stash) { |
|
1389
|
|
|
|
|
|
|
return !!1 |
|
1390
|
|
|
|
|
|
|
if ref \$globref eq 'GLOB' |
|
1391
|
0
|
|
|
|
|
0
|
? *{$globref}{CODE} |
|
1392
|
0
|
0
|
|
|
|
0
|
: ref $globref; # const or sub ref |
|
|
|
0
|
|
|
|
|
|
|
1393
|
|
|
|
|
|
|
} |
|
1394
|
0
|
|
|
|
|
0
|
return !!0; |
|
1395
|
0
|
0
|
|
|
|
0
|
})->(do { my $tmp = $_[0] }) and not $_[0]->can('new') } ? $_[0] : RoleName->get_message( $_[0] ); |
|
|
0
|
|
|
|
|
0
|
|
|
1396
|
|
|
|
|
|
|
} |
|
1397
|
|
|
|
|
|
|
|
|
1398
|
|
|
|
|
|
|
$EXPORT_TAGS{"RoleName"} = [ qw( RoleName is_RoleName assert_RoleName ) ]; |
|
1399
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"RoleName"} }; |
|
1400
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "RoleName"; |
|
1401
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_RoleName"; |
|
1402
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_RoleName"; |
|
1403
|
|
|
|
|
|
|
|
|
1404
|
|
|
|
|
|
|
} |
|
1405
|
|
|
|
|
|
|
|
|
1406
|
|
|
|
|
|
|
# ScalarRef |
|
1407
|
|
|
|
|
|
|
{ |
|
1408
|
|
|
|
|
|
|
my $type; |
|
1409
|
|
|
|
|
|
|
sub ScalarRef () { |
|
1410
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_ScalarRef, name => "ScalarRef", library => "Types::Standard", library_name => "ScalarRef" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1411
|
|
|
|
|
|
|
} |
|
1412
|
|
|
|
|
|
|
|
|
1413
|
|
|
|
|
|
|
sub is_ScalarRef ($) { |
|
1414
|
0
|
0
|
|
0
|
0
|
0
|
(ref($_[0]) eq 'SCALAR' or ref($_[0]) eq 'REF') |
|
1415
|
|
|
|
|
|
|
} |
|
1416
|
|
|
|
|
|
|
|
|
1417
|
|
|
|
|
|
|
sub assert_ScalarRef ($) { |
|
1418
|
0
|
0
|
0
|
0
|
0
|
0
|
(ref($_[0]) eq 'SCALAR' or ref($_[0]) eq 'REF') ? $_[0] : ScalarRef->get_message( $_[0] ); |
|
1419
|
|
|
|
|
|
|
} |
|
1420
|
|
|
|
|
|
|
|
|
1421
|
|
|
|
|
|
|
$EXPORT_TAGS{"ScalarRef"} = [ qw( ScalarRef is_ScalarRef assert_ScalarRef ) ]; |
|
1422
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"ScalarRef"} }; |
|
1423
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "ScalarRef"; |
|
1424
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_ScalarRef"; |
|
1425
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_ScalarRef"; |
|
1426
|
|
|
|
|
|
|
|
|
1427
|
|
|
|
|
|
|
} |
|
1428
|
|
|
|
|
|
|
|
|
1429
|
|
|
|
|
|
|
# Set |
|
1430
|
|
|
|
|
|
|
{ |
|
1431
|
|
|
|
|
|
|
my $type; |
|
1432
|
|
|
|
|
|
|
sub Set () { |
|
1433
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Set, name => "Set", library => "Acme::Mitey::Cards::Types::Source", library_name => "Set" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1434
|
|
|
|
|
|
|
} |
|
1435
|
|
|
|
|
|
|
|
|
1436
|
|
|
|
|
|
|
sub is_Set ($) { |
|
1437
|
10
|
0
|
|
10
|
0
|
117
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Set]) }) |
|
|
10
|
|
|
0
|
|
24
|
|
|
|
10
|
|
|
|
|
838
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1438
|
|
|
|
|
|
|
} |
|
1439
|
|
|
|
|
|
|
|
|
1440
|
|
|
|
|
|
|
sub assert_Set ($) { |
|
1441
|
10
|
0
|
|
10
|
0
|
68
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Set]) }) ? $_[0] : Set->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
19
|
|
|
|
10
|
|
|
|
|
30040
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1442
|
|
|
|
|
|
|
} |
|
1443
|
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
$EXPORT_TAGS{"Set"} = [ qw( Set is_Set assert_Set ) ]; |
|
1445
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Set"} }; |
|
1446
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Set"; |
|
1447
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Set"; |
|
1448
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Set"; |
|
1449
|
|
|
|
|
|
|
|
|
1450
|
|
|
|
|
|
|
} |
|
1451
|
|
|
|
|
|
|
|
|
1452
|
|
|
|
|
|
|
# SimpleStr |
|
1453
|
|
|
|
|
|
|
{ |
|
1454
|
|
|
|
|
|
|
my $type; |
|
1455
|
|
|
|
|
|
|
sub SimpleStr () { |
|
1456
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_SimpleStr, name => "SimpleStr", library => "Types::Common::String", library_name => "SimpleStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1457
|
|
|
|
|
|
|
} |
|
1458
|
|
|
|
|
|
|
|
|
1459
|
|
|
|
|
|
|
sub is_SimpleStr ($) { |
|
1460
|
0
|
0
|
0
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1461
|
|
|
|
|
|
|
} |
|
1462
|
|
|
|
|
|
|
|
|
1463
|
|
|
|
|
|
|
sub assert_SimpleStr ($) { |
|
1464
|
0
|
0
|
0
|
0
|
0
|
0
|
((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) ? $_[0] : SimpleStr->get_message( $_[0] ); |
|
1465
|
|
|
|
|
|
|
} |
|
1466
|
|
|
|
|
|
|
|
|
1467
|
|
|
|
|
|
|
$EXPORT_TAGS{"SimpleStr"} = [ qw( SimpleStr is_SimpleStr assert_SimpleStr ) ]; |
|
1468
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"SimpleStr"} }; |
|
1469
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "SimpleStr"; |
|
1470
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_SimpleStr"; |
|
1471
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_SimpleStr"; |
|
1472
|
|
|
|
|
|
|
|
|
1473
|
|
|
|
|
|
|
} |
|
1474
|
|
|
|
|
|
|
|
|
1475
|
|
|
|
|
|
|
# SingleDigit |
|
1476
|
|
|
|
|
|
|
{ |
|
1477
|
|
|
|
|
|
|
my $type; |
|
1478
|
|
|
|
|
|
|
sub SingleDigit () { |
|
1479
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_SingleDigit, name => "SingleDigit", library => "Types::Common::Numeric", library_name => "SingleDigit" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1480
|
|
|
|
|
|
|
} |
|
1481
|
|
|
|
|
|
|
|
|
1482
|
|
|
|
|
|
|
sub is_SingleDigit ($) { |
|
1483
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= -9) && ($_[0] <= 9)) |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1484
|
|
|
|
|
|
|
} |
|
1485
|
|
|
|
|
|
|
|
|
1486
|
|
|
|
|
|
|
sub assert_SingleDigit ($) { |
|
1487
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { (do { my $tmp = $_[0]; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) } && ($_[0] >= -9) && ($_[0] <= 9)) ? $_[0] : SingleDigit->get_message( $_[0] ); |
|
1488
|
|
|
|
|
|
|
} |
|
1489
|
|
|
|
|
|
|
|
|
1490
|
|
|
|
|
|
|
$EXPORT_TAGS{"SingleDigit"} = [ qw( SingleDigit is_SingleDigit assert_SingleDigit ) ]; |
|
1491
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"SingleDigit"} }; |
|
1492
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "SingleDigit"; |
|
1493
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_SingleDigit"; |
|
1494
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_SingleDigit"; |
|
1495
|
|
|
|
|
|
|
|
|
1496
|
|
|
|
|
|
|
} |
|
1497
|
|
|
|
|
|
|
|
|
1498
|
|
|
|
|
|
|
# Slurpy |
|
1499
|
|
|
|
|
|
|
{ |
|
1500
|
|
|
|
|
|
|
my $type; |
|
1501
|
|
|
|
|
|
|
sub Slurpy () { |
|
1502
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_Slurpy, name => "Slurpy", library => "Types::Standard", library_name => "Slurpy" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1503
|
|
|
|
|
|
|
} |
|
1504
|
|
|
|
|
|
|
|
|
1505
|
|
|
|
|
|
|
sub is_Slurpy ($) { |
|
1506
|
0
|
|
|
0
|
0
|
0
|
(!!1) |
|
1507
|
|
|
|
|
|
|
} |
|
1508
|
|
|
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
sub assert_Slurpy ($) { |
|
1510
|
0
|
|
|
0
|
0
|
0
|
(!!1) ? $_[0] : Slurpy->get_message( $_[0] ); |
|
1511
|
|
|
|
|
|
|
} |
|
1512
|
|
|
|
|
|
|
|
|
1513
|
|
|
|
|
|
|
$EXPORT_TAGS{"Slurpy"} = [ qw( Slurpy is_Slurpy assert_Slurpy ) ]; |
|
1514
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Slurpy"} }; |
|
1515
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Slurpy"; |
|
1516
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Slurpy"; |
|
1517
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Slurpy"; |
|
1518
|
|
|
|
|
|
|
|
|
1519
|
|
|
|
|
|
|
} |
|
1520
|
|
|
|
|
|
|
|
|
1521
|
|
|
|
|
|
|
# Str |
|
1522
|
|
|
|
|
|
|
{ |
|
1523
|
|
|
|
|
|
|
my $type; |
|
1524
|
|
|
|
|
|
|
sub Str () { |
|
1525
|
25
|
|
100
|
25
|
1
|
129
|
$type ||= bless( { check => \&is_Str, name => "Str", library => "Types::Standard", library_name => "Str" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1526
|
|
|
|
|
|
|
} |
|
1527
|
|
|
|
|
|
|
|
|
1528
|
|
|
|
|
|
|
sub is_Str ($) { |
|
1529
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1530
|
|
|
|
|
|
|
} |
|
1531
|
|
|
|
|
|
|
|
|
1532
|
|
|
|
|
|
|
sub assert_Str ($) { |
|
1533
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : Str->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1534
|
|
|
|
|
|
|
} |
|
1535
|
|
|
|
|
|
|
|
|
1536
|
|
|
|
|
|
|
$EXPORT_TAGS{"Str"} = [ qw( Str is_Str assert_Str ) ]; |
|
1537
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Str"} }; |
|
1538
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Str"; |
|
1539
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Str"; |
|
1540
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Str"; |
|
1541
|
|
|
|
|
|
|
|
|
1542
|
|
|
|
|
|
|
} |
|
1543
|
|
|
|
|
|
|
|
|
1544
|
|
|
|
|
|
|
# StrLength |
|
1545
|
|
|
|
|
|
|
{ |
|
1546
|
|
|
|
|
|
|
my $type; |
|
1547
|
|
|
|
|
|
|
sub StrLength () { |
|
1548
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_StrLength, name => "StrLength", library => "Types::Common::String", library_name => "StrLength" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1549
|
|
|
|
|
|
|
} |
|
1550
|
|
|
|
|
|
|
|
|
1551
|
|
|
|
|
|
|
sub is_StrLength ($) { |
|
1552
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1553
|
|
|
|
|
|
|
} |
|
1554
|
|
|
|
|
|
|
|
|
1555
|
|
|
|
|
|
|
sub assert_StrLength ($) { |
|
1556
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : StrLength->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1557
|
|
|
|
|
|
|
} |
|
1558
|
|
|
|
|
|
|
|
|
1559
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrLength"} = [ qw( StrLength is_StrLength assert_StrLength ) ]; |
|
1560
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrLength"} }; |
|
1561
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrLength"; |
|
1562
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrLength"; |
|
1563
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrLength"; |
|
1564
|
|
|
|
|
|
|
|
|
1565
|
|
|
|
|
|
|
} |
|
1566
|
|
|
|
|
|
|
|
|
1567
|
|
|
|
|
|
|
# StrMatch |
|
1568
|
|
|
|
|
|
|
{ |
|
1569
|
|
|
|
|
|
|
my $type; |
|
1570
|
|
|
|
|
|
|
sub StrMatch () { |
|
1571
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_StrMatch, name => "StrMatch", library => "Types::Standard", library_name => "StrMatch" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1572
|
|
|
|
|
|
|
} |
|
1573
|
|
|
|
|
|
|
|
|
1574
|
|
|
|
|
|
|
sub is_StrMatch ($) { |
|
1575
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1576
|
|
|
|
|
|
|
} |
|
1577
|
|
|
|
|
|
|
|
|
1578
|
|
|
|
|
|
|
sub assert_StrMatch ($) { |
|
1579
|
0
|
0
|
|
0
|
0
|
0
|
do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } } ? $_[0] : StrMatch->get_message( $_[0] ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1580
|
|
|
|
|
|
|
} |
|
1581
|
|
|
|
|
|
|
|
|
1582
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrMatch"} = [ qw( StrMatch is_StrMatch assert_StrMatch ) ]; |
|
1583
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrMatch"} }; |
|
1584
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrMatch"; |
|
1585
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrMatch"; |
|
1586
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrMatch"; |
|
1587
|
|
|
|
|
|
|
|
|
1588
|
|
|
|
|
|
|
} |
|
1589
|
|
|
|
|
|
|
|
|
1590
|
|
|
|
|
|
|
# StrictNum |
|
1591
|
|
|
|
|
|
|
{ |
|
1592
|
|
|
|
|
|
|
my $type; |
|
1593
|
|
|
|
|
|
|
sub StrictNum () { |
|
1594
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_StrictNum, name => "StrictNum", library => "Types::Standard", library_name => "StrictNum" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1595
|
|
|
|
|
|
|
} |
|
1596
|
|
|
|
|
|
|
|
|
1597
|
|
|
|
|
|
|
sub is_StrictNum ($) { |
|
1598
|
0
|
0
|
0
|
0
|
0
|
0
|
do { my $val = $_[0];(defined($val) and not ref($val)) && ( $val =~ /\A[+-]?[0-9]+\z/ || $val =~ /\A(?:[+-]?) # matches optional +- in the beginning |
|
|
0
|
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1599
|
|
|
|
|
|
|
(?=[0-9]|\.[0-9]) # matches previous +- only if there is something like 3 or .3 |
|
1600
|
|
|
|
|
|
|
[0-9]* # matches 0-9 zero or more times |
|
1601
|
|
|
|
|
|
|
(?:\.[0-9]+)? # matches optional .89 or nothing |
|
1602
|
|
|
|
|
|
|
(?:[Ee](?:[+-]?[0-9]+))? # matches E1 or e1 or e-1 or e+1 etc |
|
1603
|
|
|
|
|
|
|
\z/x ); } |
|
1604
|
|
|
|
|
|
|
} |
|
1605
|
|
|
|
|
|
|
|
|
1606
|
|
|
|
|
|
|
sub assert_StrictNum ($) { |
|
1607
|
0
|
0
|
0
|
0
|
0
|
0
|
do { my $val = $_[0];(defined($val) and not ref($val)) && ( $val =~ /\A[+-]?[0-9]+\z/ || $val =~ /\A(?:[+-]?) # matches optional +- in the beginning |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
1608
|
|
|
|
|
|
|
(?=[0-9]|\.[0-9]) # matches previous +- only if there is something like 3 or .3 |
|
1609
|
|
|
|
|
|
|
[0-9]* # matches 0-9 zero or more times |
|
1610
|
|
|
|
|
|
|
(?:\.[0-9]+)? # matches optional .89 or nothing |
|
1611
|
|
|
|
|
|
|
(?:[Ee](?:[+-]?[0-9]+))? # matches E1 or e1 or e-1 or e+1 etc |
|
1612
|
|
|
|
|
|
|
\z/x ); } ? $_[0] : StrictNum->get_message( $_[0] ); |
|
1613
|
|
|
|
|
|
|
} |
|
1614
|
|
|
|
|
|
|
|
|
1615
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrictNum"} = [ qw( StrictNum is_StrictNum assert_StrictNum ) ]; |
|
1616
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrictNum"} }; |
|
1617
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrictNum"; |
|
1618
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrictNum"; |
|
1619
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrictNum"; |
|
1620
|
|
|
|
|
|
|
|
|
1621
|
|
|
|
|
|
|
} |
|
1622
|
|
|
|
|
|
|
|
|
1623
|
|
|
|
|
|
|
# StrongPassword |
|
1624
|
|
|
|
|
|
|
{ |
|
1625
|
|
|
|
|
|
|
my $type; |
|
1626
|
|
|
|
|
|
|
sub StrongPassword () { |
|
1627
|
0
|
|
0
|
0
|
1
|
0
|
$type ||= bless( { check => \&is_StrongPassword, name => "StrongPassword", library => "Types::Common::String", library_name => "StrongPassword" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1628
|
|
|
|
|
|
|
} |
|
1629
|
|
|
|
|
|
|
|
|
1630
|
|
|
|
|
|
|
sub is_StrongPassword ($) { |
|
1631
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 7) && ($_[0] =~ /[^a-zA-Z]/)) |
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
1632
|
|
|
|
|
|
|
} |
|
1633
|
|
|
|
|
|
|
|
|
1634
|
|
|
|
|
|
|
sub assert_StrongPassword ($) { |
|
1635
|
0
|
0
|
0
|
0
|
0
|
0
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 7) && ($_[0] =~ /[^a-zA-Z]/)) ? $_[0] : StrongPassword->get_message( $_[0] ); |
|
1636
|
|
|
|
|
|
|
} |
|
1637
|
|
|
|
|
|
|
|
|
1638
|
|
|
|
|
|
|
$EXPORT_TAGS{"StrongPassword"} = [ qw( StrongPassword is_StrongPassword assert_StrongPassword ) ]; |
|
1639
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"StrongPassword"} }; |
|
1640
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "StrongPassword"; |
|
1641
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_StrongPassword"; |
|
1642
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_StrongPassword"; |
|
1643
|
|
|
|
|
|
|
|
|
1644
|
|
|
|
|
|
|
} |
|
1645
|
|
|
|
|
|
|
|
|
1646
|
|
|
|
|
|
|
# Suit |
|
1647
|
|
|
|
|
|
|
{ |
|
1648
|
|
|
|
|
|
|
my $type; |
|
1649
|
|
|
|
|
|
|
sub Suit () { |
|
1650
|
8
|
|
100
|
8
|
1
|
78
|
$type ||= bless( { check => \&is_Suit, name => "Suit", library => "Acme::Mitey::Cards::Types::Source", library_name => "Suit" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1651
|
|
|
|
|
|
|
} |
|
1652
|
|
|
|
|
|
|
|
|
1653
|
|
|
|
|
|
|
sub is_Suit ($) { |
|
1654
|
10
|
0
|
|
10
|
0
|
91
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Suit]) }) |
|
|
10
|
|
|
0
|
|
21
|
|
|
|
10
|
|
|
|
|
868
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1655
|
|
|
|
|
|
|
} |
|
1656
|
|
|
|
|
|
|
|
|
1657
|
|
|
|
|
|
|
sub assert_Suit ($) { |
|
1658
|
10
|
0
|
|
10
|
0
|
73
|
(do { use Scalar::Util (); Scalar::Util::blessed($_[0]) and $_[0]->isa(q[Acme::Mitey::Cards::Suit]) }) ? $_[0] : Suit->get_message( $_[0] ); |
|
|
10
|
0
|
|
0
|
|
31
|
|
|
|
10
|
|
|
|
|
2670
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1659
|
|
|
|
|
|
|
} |
|
1660
|
|
|
|
|
|
|
|
|
1661
|
|
|
|
|
|
|
$EXPORT_TAGS{"Suit"} = [ qw( Suit is_Suit assert_Suit ) ]; |
|
1662
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Suit"} }; |
|
1663
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Suit"; |
|
1664
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Suit"; |
|
1665
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Suit"; |
|
1666
|
|
|
|
|
|
|
|
|
1667
|
|
|
|
|
|
|
} |
|
1668
|
|
|
|
|
|
|
|
|
1669
|
|
|
|
|
|
|
# Tied |
|
1670
|
|
|
|
|
|
|
{ |
|
1671
|
|
|
|
|
|
|
my $type; |
|
1672
|
|
|
|
|
|
|
sub Tied () { |
|
1673
|
0
|
|
0
|
0
|
1
|
|
$type ||= bless( { check => \&is_Tied, name => "Tied", library => "Types::Standard", library_name => "Tied" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1674
|
|
|
|
|
|
|
} |
|
1675
|
|
|
|
|
|
|
|
|
1676
|
|
|
|
|
|
|
sub is_Tied ($) { |
|
1677
|
10
|
|
0
|
10
|
0
|
76
|
(do { use Scalar::Util (); (!!ref($_[0])) and !!tied(Scalar::Util::reftype($_[0]) eq 'HASH' ? %{$_[0]} : Scalar::Util::reftype($_[0]) eq 'ARRAY' ? @{$_[0]} : Scalar::Util::reftype($_[0]) =~ /^(SCALAR|REF)$/ ? ${$_[0]} : undef) }) |
|
|
10
|
|
|
0
|
|
21
|
|
|
|
10
|
|
|
|
|
1787
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1678
|
|
|
|
|
|
|
} |
|
1679
|
|
|
|
|
|
|
|
|
1680
|
|
|
|
|
|
|
sub assert_Tied ($) { |
|
1681
|
10
|
0
|
0
|
10
|
0
|
77
|
(do { use Scalar::Util (); (!!ref($_[0])) and !!tied(Scalar::Util::reftype($_[0]) eq 'HASH' ? %{$_[0]} : Scalar::Util::reftype($_[0]) eq 'ARRAY' ? @{$_[0]} : Scalar::Util::reftype($_[0]) =~ /^(SCALAR|REF)$/ ? ${$_[0]} : undef) }) ? $_[0] : Tied->get_message( $_[0] ); |
|
|
10
|
|
|
0
|
|
24
|
|
|
|
10
|
|
|
|
|
8337
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1682
|
|
|
|
|
|
|
} |
|
1683
|
|
|
|
|
|
|
|
|
1684
|
|
|
|
|
|
|
$EXPORT_TAGS{"Tied"} = [ qw( Tied is_Tied assert_Tied ) ]; |
|
1685
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Tied"} }; |
|
1686
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Tied"; |
|
1687
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Tied"; |
|
1688
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Tied"; |
|
1689
|
|
|
|
|
|
|
|
|
1690
|
|
|
|
|
|
|
} |
|
1691
|
|
|
|
|
|
|
|
|
1692
|
|
|
|
|
|
|
# Tuple |
|
1693
|
|
|
|
|
|
|
{ |
|
1694
|
|
|
|
|
|
|
my $type; |
|
1695
|
|
|
|
|
|
|
sub Tuple () { |
|
1696
|
0
|
|
0
|
0
|
1
|
|
$type ||= bless( { check => \&is_Tuple, name => "Tuple", library => "Types::Standard", library_name => "Tuple" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1697
|
|
|
|
|
|
|
} |
|
1698
|
|
|
|
|
|
|
|
|
1699
|
|
|
|
|
|
|
sub is_Tuple ($) { |
|
1700
|
0
|
|
|
0
|
0
|
|
(ref($_[0]) eq 'ARRAY') |
|
1701
|
|
|
|
|
|
|
} |
|
1702
|
|
|
|
|
|
|
|
|
1703
|
|
|
|
|
|
|
sub assert_Tuple ($) { |
|
1704
|
0
|
0
|
|
0
|
0
|
|
(ref($_[0]) eq 'ARRAY') ? $_[0] : Tuple->get_message( $_[0] ); |
|
1705
|
|
|
|
|
|
|
} |
|
1706
|
|
|
|
|
|
|
|
|
1707
|
|
|
|
|
|
|
$EXPORT_TAGS{"Tuple"} = [ qw( Tuple is_Tuple assert_Tuple ) ]; |
|
1708
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Tuple"} }; |
|
1709
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Tuple"; |
|
1710
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Tuple"; |
|
1711
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Tuple"; |
|
1712
|
|
|
|
|
|
|
|
|
1713
|
|
|
|
|
|
|
} |
|
1714
|
|
|
|
|
|
|
|
|
1715
|
|
|
|
|
|
|
# Undef |
|
1716
|
|
|
|
|
|
|
{ |
|
1717
|
|
|
|
|
|
|
my $type; |
|
1718
|
|
|
|
|
|
|
sub Undef () { |
|
1719
|
0
|
|
0
|
0
|
1
|
|
$type ||= bless( { check => \&is_Undef, name => "Undef", library => "Types::Standard", library_name => "Undef" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1720
|
|
|
|
|
|
|
} |
|
1721
|
|
|
|
|
|
|
|
|
1722
|
|
|
|
|
|
|
sub is_Undef ($) { |
|
1723
|
0
|
|
|
0
|
0
|
|
(!defined($_[0])) |
|
1724
|
|
|
|
|
|
|
} |
|
1725
|
|
|
|
|
|
|
|
|
1726
|
|
|
|
|
|
|
sub assert_Undef ($) { |
|
1727
|
0
|
0
|
|
0
|
0
|
|
(!defined($_[0])) ? $_[0] : Undef->get_message( $_[0] ); |
|
1728
|
|
|
|
|
|
|
} |
|
1729
|
|
|
|
|
|
|
|
|
1730
|
|
|
|
|
|
|
$EXPORT_TAGS{"Undef"} = [ qw( Undef is_Undef assert_Undef ) ]; |
|
1731
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Undef"} }; |
|
1732
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Undef"; |
|
1733
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Undef"; |
|
1734
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Undef"; |
|
1735
|
|
|
|
|
|
|
|
|
1736
|
|
|
|
|
|
|
} |
|
1737
|
|
|
|
|
|
|
|
|
1738
|
|
|
|
|
|
|
# UpperCaseSimpleStr |
|
1739
|
|
|
|
|
|
|
{ |
|
1740
|
|
|
|
|
|
|
my $type; |
|
1741
|
|
|
|
|
|
|
sub UpperCaseSimpleStr () { |
|
1742
|
0
|
|
0
|
0
|
1
|
|
$type ||= bless( { check => \&is_UpperCaseSimpleStr, name => "UpperCaseSimpleStr", library => "Types::Common::String", library_name => "UpperCaseSimpleStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1743
|
|
|
|
|
|
|
} |
|
1744
|
|
|
|
|
|
|
|
|
1745
|
|
|
|
|
|
|
sub is_UpperCaseSimpleStr ($) { |
|
1746
|
0
|
0
|
0
|
0
|
0
|
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1747
|
|
|
|
|
|
|
} |
|
1748
|
|
|
|
|
|
|
|
|
1749
|
|
|
|
|
|
|
sub assert_UpperCaseSimpleStr ($) { |
|
1750
|
0
|
0
|
0
|
0
|
0
|
|
(do { (do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) <= 255) && ($_[0] !~ /\n/)) } && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) ? $_[0] : UpperCaseSimpleStr->get_message( $_[0] ); |
|
1751
|
|
|
|
|
|
|
} |
|
1752
|
|
|
|
|
|
|
|
|
1753
|
|
|
|
|
|
|
$EXPORT_TAGS{"UpperCaseSimpleStr"} = [ qw( UpperCaseSimpleStr is_UpperCaseSimpleStr assert_UpperCaseSimpleStr ) ]; |
|
1754
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"UpperCaseSimpleStr"} }; |
|
1755
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "UpperCaseSimpleStr"; |
|
1756
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_UpperCaseSimpleStr"; |
|
1757
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_UpperCaseSimpleStr"; |
|
1758
|
|
|
|
|
|
|
|
|
1759
|
|
|
|
|
|
|
} |
|
1760
|
|
|
|
|
|
|
|
|
1761
|
|
|
|
|
|
|
# UpperCaseStr |
|
1762
|
|
|
|
|
|
|
{ |
|
1763
|
|
|
|
|
|
|
my $type; |
|
1764
|
|
|
|
|
|
|
sub UpperCaseStr () { |
|
1765
|
0
|
|
0
|
0
|
1
|
|
$type ||= bless( { check => \&is_UpperCaseStr, name => "UpperCaseStr", library => "Types::Common::String", library_name => "UpperCaseStr" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1766
|
|
|
|
|
|
|
} |
|
1767
|
|
|
|
|
|
|
|
|
1768
|
|
|
|
|
|
|
sub is_UpperCaseStr ($) { |
|
1769
|
0
|
0
|
|
0
|
0
|
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
1770
|
|
|
|
|
|
|
} |
|
1771
|
|
|
|
|
|
|
|
|
1772
|
|
|
|
|
|
|
sub assert_UpperCaseStr ($) { |
|
1773
|
0
|
0
|
0
|
0
|
0
|
|
(do { ((do { defined($_[0]) and do { ref(\$_[0]) eq 'SCALAR' or ref(\(my $val = $_[0])) eq 'SCALAR' } }) && (length($_[0]) > 0)) } && do { $_[0] !~ /\p{Lower}/ms }) ? $_[0] : UpperCaseStr->get_message( $_[0] ); |
|
1774
|
|
|
|
|
|
|
} |
|
1775
|
|
|
|
|
|
|
|
|
1776
|
|
|
|
|
|
|
$EXPORT_TAGS{"UpperCaseStr"} = [ qw( UpperCaseStr is_UpperCaseStr assert_UpperCaseStr ) ]; |
|
1777
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"UpperCaseStr"} }; |
|
1778
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "UpperCaseStr"; |
|
1779
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_UpperCaseStr"; |
|
1780
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_UpperCaseStr"; |
|
1781
|
|
|
|
|
|
|
|
|
1782
|
|
|
|
|
|
|
} |
|
1783
|
|
|
|
|
|
|
|
|
1784
|
|
|
|
|
|
|
# Value |
|
1785
|
|
|
|
|
|
|
{ |
|
1786
|
|
|
|
|
|
|
my $type; |
|
1787
|
|
|
|
|
|
|
sub Value () { |
|
1788
|
0
|
|
0
|
0
|
1
|
|
$type ||= bless( { check => \&is_Value, name => "Value", library => "Types::Standard", library_name => "Value" }, "Acme::Mitey::Cards::Types::TypeConstraint" ); |
|
1789
|
|
|
|
|
|
|
} |
|
1790
|
|
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
sub is_Value ($) { |
|
1792
|
0
|
0
|
|
0
|
0
|
|
(defined($_[0]) and not ref($_[0])) |
|
1793
|
|
|
|
|
|
|
} |
|
1794
|
|
|
|
|
|
|
|
|
1795
|
|
|
|
|
|
|
sub assert_Value ($) { |
|
1796
|
0
|
0
|
0
|
0
|
0
|
|
(defined($_[0]) and not ref($_[0])) ? $_[0] : Value->get_message( $_[0] ); |
|
1797
|
|
|
|
|
|
|
} |
|
1798
|
|
|
|
|
|
|
|
|
1799
|
|
|
|
|
|
|
$EXPORT_TAGS{"Value"} = [ qw( Value is_Value assert_Value ) ]; |
|
1800
|
|
|
|
|
|
|
push @EXPORT_OK, @{ $EXPORT_TAGS{"Value"} }; |
|
1801
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"types"} }, "Value"; |
|
1802
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"is"} }, "is_Value"; |
|
1803
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{"assert"} }, "assert_Value"; |
|
1804
|
|
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
} |
|
1806
|
|
|
|
|
|
|
|
|
1807
|
|
|
|
|
|
|
|
|
1808
|
|
|
|
|
|
|
1; |
|
1809
|
|
|
|
|
|
|
__END__ |
|
1810
|
|
|
|
|
|
|
|
|
1811
|
|
|
|
|
|
|
=head1 NAME |
|
1812
|
|
|
|
|
|
|
|
|
1813
|
|
|
|
|
|
|
Acme::Mitey::Cards::Types - type constraint library |
|
1814
|
|
|
|
|
|
|
|
|
1815
|
|
|
|
|
|
|
=head1 TYPES |
|
1816
|
|
|
|
|
|
|
|
|
1817
|
|
|
|
|
|
|
This type constraint library is even more basic that L<Type::Tiny>. Exported |
|
1818
|
|
|
|
|
|
|
types may be combined using C<< Foo | Bar >> but parameterized type constraints |
|
1819
|
|
|
|
|
|
|
like C<< Foo[Bar] >> are not supported. |
|
1820
|
|
|
|
|
|
|
|
|
1821
|
|
|
|
|
|
|
=head2 B<Any> |
|
1822
|
|
|
|
|
|
|
|
|
1823
|
|
|
|
|
|
|
Based on B<Any> in L<Types::Standard>. |
|
1824
|
|
|
|
|
|
|
|
|
1825
|
|
|
|
|
|
|
The C<< Any >> constant returns a blessed type constraint object. |
|
1826
|
|
|
|
|
|
|
C<< is_Any($value) >> checks a value against the type and returns a boolean. |
|
1827
|
|
|
|
|
|
|
C<< assert_Any($value) >> checks a value against the type and throws an error. |
|
1828
|
|
|
|
|
|
|
|
|
1829
|
|
|
|
|
|
|
To import all of these functions: |
|
1830
|
|
|
|
|
|
|
|
|
1831
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Any ); |
|
1832
|
|
|
|
|
|
|
|
|
1833
|
|
|
|
|
|
|
=head2 B<ArrayRef> |
|
1834
|
|
|
|
|
|
|
|
|
1835
|
|
|
|
|
|
|
Based on B<ArrayRef> in L<Types::Standard>. |
|
1836
|
|
|
|
|
|
|
|
|
1837
|
|
|
|
|
|
|
The C<< ArrayRef >> constant returns a blessed type constraint object. |
|
1838
|
|
|
|
|
|
|
C<< is_ArrayRef($value) >> checks a value against the type and returns a boolean. |
|
1839
|
|
|
|
|
|
|
C<< assert_ArrayRef($value) >> checks a value against the type and throws an error. |
|
1840
|
|
|
|
|
|
|
|
|
1841
|
|
|
|
|
|
|
To import all of these functions: |
|
1842
|
|
|
|
|
|
|
|
|
1843
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :ArrayRef ); |
|
1844
|
|
|
|
|
|
|
|
|
1845
|
|
|
|
|
|
|
=head2 B<Bool> |
|
1846
|
|
|
|
|
|
|
|
|
1847
|
|
|
|
|
|
|
Based on B<Bool> in L<Types::Standard>. |
|
1848
|
|
|
|
|
|
|
|
|
1849
|
|
|
|
|
|
|
The C<< Bool >> constant returns a blessed type constraint object. |
|
1850
|
|
|
|
|
|
|
C<< is_Bool($value) >> checks a value against the type and returns a boolean. |
|
1851
|
|
|
|
|
|
|
C<< assert_Bool($value) >> checks a value against the type and throws an error. |
|
1852
|
|
|
|
|
|
|
|
|
1853
|
|
|
|
|
|
|
To import all of these functions: |
|
1854
|
|
|
|
|
|
|
|
|
1855
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Bool ); |
|
1856
|
|
|
|
|
|
|
|
|
1857
|
|
|
|
|
|
|
=head2 B<Card> |
|
1858
|
|
|
|
|
|
|
|
|
1859
|
|
|
|
|
|
|
Based on B<Card> in L<Acme::Mitey::Cards::Types::Source>. |
|
1860
|
|
|
|
|
|
|
|
|
1861
|
|
|
|
|
|
|
The C<< Card >> constant returns a blessed type constraint object. |
|
1862
|
|
|
|
|
|
|
C<< is_Card($value) >> checks a value against the type and returns a boolean. |
|
1863
|
|
|
|
|
|
|
C<< assert_Card($value) >> checks a value against the type and throws an error. |
|
1864
|
|
|
|
|
|
|
|
|
1865
|
|
|
|
|
|
|
To import all of these functions: |
|
1866
|
|
|
|
|
|
|
|
|
1867
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Card ); |
|
1868
|
|
|
|
|
|
|
|
|
1869
|
|
|
|
|
|
|
=head2 B<CardArray> |
|
1870
|
|
|
|
|
|
|
|
|
1871
|
|
|
|
|
|
|
Based on B<CardArray> in L<Acme::Mitey::Cards::Types::Source>. |
|
1872
|
|
|
|
|
|
|
|
|
1873
|
|
|
|
|
|
|
The C<< CardArray >> constant returns a blessed type constraint object. |
|
1874
|
|
|
|
|
|
|
C<< is_CardArray($value) >> checks a value against the type and returns a boolean. |
|
1875
|
|
|
|
|
|
|
C<< assert_CardArray($value) >> checks a value against the type and throws an error. |
|
1876
|
|
|
|
|
|
|
|
|
1877
|
|
|
|
|
|
|
To import all of these functions: |
|
1878
|
|
|
|
|
|
|
|
|
1879
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :CardArray ); |
|
1880
|
|
|
|
|
|
|
|
|
1881
|
|
|
|
|
|
|
=head2 B<CardNumber> |
|
1882
|
|
|
|
|
|
|
|
|
1883
|
|
|
|
|
|
|
Based on B<CardNumber> in L<Acme::Mitey::Cards::Types::Source>. |
|
1884
|
|
|
|
|
|
|
|
|
1885
|
|
|
|
|
|
|
The C<< CardNumber >> constant returns a blessed type constraint object. |
|
1886
|
|
|
|
|
|
|
C<< is_CardNumber($value) >> checks a value against the type and returns a boolean. |
|
1887
|
|
|
|
|
|
|
C<< assert_CardNumber($value) >> checks a value against the type and throws an error. |
|
1888
|
|
|
|
|
|
|
|
|
1889
|
|
|
|
|
|
|
To import all of these functions: |
|
1890
|
|
|
|
|
|
|
|
|
1891
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :CardNumber ); |
|
1892
|
|
|
|
|
|
|
|
|
1893
|
|
|
|
|
|
|
=head2 B<Character> |
|
1894
|
|
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
|
Based on B<Character> in L<Acme::Mitey::Cards::Types::Source>. |
|
1896
|
|
|
|
|
|
|
|
|
1897
|
|
|
|
|
|
|
The C<< Character >> constant returns a blessed type constraint object. |
|
1898
|
|
|
|
|
|
|
C<< is_Character($value) >> checks a value against the type and returns a boolean. |
|
1899
|
|
|
|
|
|
|
C<< assert_Character($value) >> checks a value against the type and throws an error. |
|
1900
|
|
|
|
|
|
|
|
|
1901
|
|
|
|
|
|
|
To import all of these functions: |
|
1902
|
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Character ); |
|
1904
|
|
|
|
|
|
|
|
|
1905
|
|
|
|
|
|
|
=head2 B<ClassName> |
|
1906
|
|
|
|
|
|
|
|
|
1907
|
|
|
|
|
|
|
Based on B<ClassName> in L<Types::Standard>. |
|
1908
|
|
|
|
|
|
|
|
|
1909
|
|
|
|
|
|
|
The C<< ClassName >> constant returns a blessed type constraint object. |
|
1910
|
|
|
|
|
|
|
C<< is_ClassName($value) >> checks a value against the type and returns a boolean. |
|
1911
|
|
|
|
|
|
|
C<< assert_ClassName($value) >> checks a value against the type and throws an error. |
|
1912
|
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
To import all of these functions: |
|
1914
|
|
|
|
|
|
|
|
|
1915
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :ClassName ); |
|
1916
|
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
=head2 B<CodeRef> |
|
1918
|
|
|
|
|
|
|
|
|
1919
|
|
|
|
|
|
|
Based on B<CodeRef> in L<Types::Standard>. |
|
1920
|
|
|
|
|
|
|
|
|
1921
|
|
|
|
|
|
|
The C<< CodeRef >> constant returns a blessed type constraint object. |
|
1922
|
|
|
|
|
|
|
C<< is_CodeRef($value) >> checks a value against the type and returns a boolean. |
|
1923
|
|
|
|
|
|
|
C<< assert_CodeRef($value) >> checks a value against the type and throws an error. |
|
1924
|
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
To import all of these functions: |
|
1926
|
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :CodeRef ); |
|
1928
|
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
=head2 B<ConsumerOf> |
|
1930
|
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
Based on B<ConsumerOf> in L<Types::Standard>. |
|
1932
|
|
|
|
|
|
|
|
|
1933
|
|
|
|
|
|
|
The C<< ConsumerOf >> constant returns a blessed type constraint object. |
|
1934
|
|
|
|
|
|
|
C<< is_ConsumerOf($value) >> checks a value against the type and returns a boolean. |
|
1935
|
|
|
|
|
|
|
C<< assert_ConsumerOf($value) >> checks a value against the type and throws an error. |
|
1936
|
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
To import all of these functions: |
|
1938
|
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :ConsumerOf ); |
|
1940
|
|
|
|
|
|
|
|
|
1941
|
|
|
|
|
|
|
=head2 B<CycleTuple> |
|
1942
|
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
Based on B<CycleTuple> in L<Types::Standard>. |
|
1944
|
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
The C<< CycleTuple >> constant returns a blessed type constraint object. |
|
1946
|
|
|
|
|
|
|
C<< is_CycleTuple($value) >> checks a value against the type and returns a boolean. |
|
1947
|
|
|
|
|
|
|
C<< assert_CycleTuple($value) >> checks a value against the type and throws an error. |
|
1948
|
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
To import all of these functions: |
|
1950
|
|
|
|
|
|
|
|
|
1951
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :CycleTuple ); |
|
1952
|
|
|
|
|
|
|
|
|
1953
|
|
|
|
|
|
|
=head2 B<Deck> |
|
1954
|
|
|
|
|
|
|
|
|
1955
|
|
|
|
|
|
|
Based on B<Deck> in L<Acme::Mitey::Cards::Types::Source>. |
|
1956
|
|
|
|
|
|
|
|
|
1957
|
|
|
|
|
|
|
The C<< Deck >> constant returns a blessed type constraint object. |
|
1958
|
|
|
|
|
|
|
C<< is_Deck($value) >> checks a value against the type and returns a boolean. |
|
1959
|
|
|
|
|
|
|
C<< assert_Deck($value) >> checks a value against the type and throws an error. |
|
1960
|
|
|
|
|
|
|
|
|
1961
|
|
|
|
|
|
|
To import all of these functions: |
|
1962
|
|
|
|
|
|
|
|
|
1963
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Deck ); |
|
1964
|
|
|
|
|
|
|
|
|
1965
|
|
|
|
|
|
|
=head2 B<Defined> |
|
1966
|
|
|
|
|
|
|
|
|
1967
|
|
|
|
|
|
|
Based on B<Defined> in L<Types::Standard>. |
|
1968
|
|
|
|
|
|
|
|
|
1969
|
|
|
|
|
|
|
The C<< Defined >> constant returns a blessed type constraint object. |
|
1970
|
|
|
|
|
|
|
C<< is_Defined($value) >> checks a value against the type and returns a boolean. |
|
1971
|
|
|
|
|
|
|
C<< assert_Defined($value) >> checks a value against the type and throws an error. |
|
1972
|
|
|
|
|
|
|
|
|
1973
|
|
|
|
|
|
|
To import all of these functions: |
|
1974
|
|
|
|
|
|
|
|
|
1975
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Defined ); |
|
1976
|
|
|
|
|
|
|
|
|
1977
|
|
|
|
|
|
|
=head2 B<DelimitedStr> |
|
1978
|
|
|
|
|
|
|
|
|
1979
|
|
|
|
|
|
|
Based on B<DelimitedStr> in L<Types::Common::String>. |
|
1980
|
|
|
|
|
|
|
|
|
1981
|
|
|
|
|
|
|
The C<< DelimitedStr >> constant returns a blessed type constraint object. |
|
1982
|
|
|
|
|
|
|
C<< is_DelimitedStr($value) >> checks a value against the type and returns a boolean. |
|
1983
|
|
|
|
|
|
|
C<< assert_DelimitedStr($value) >> checks a value against the type and throws an error. |
|
1984
|
|
|
|
|
|
|
|
|
1985
|
|
|
|
|
|
|
To import all of these functions: |
|
1986
|
|
|
|
|
|
|
|
|
1987
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :DelimitedStr ); |
|
1988
|
|
|
|
|
|
|
|
|
1989
|
|
|
|
|
|
|
=head2 B<Dict> |
|
1990
|
|
|
|
|
|
|
|
|
1991
|
|
|
|
|
|
|
Based on B<Dict> in L<Types::Standard>. |
|
1992
|
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
The C<< Dict >> constant returns a blessed type constraint object. |
|
1994
|
|
|
|
|
|
|
C<< is_Dict($value) >> checks a value against the type and returns a boolean. |
|
1995
|
|
|
|
|
|
|
C<< assert_Dict($value) >> checks a value against the type and throws an error. |
|
1996
|
|
|
|
|
|
|
|
|
1997
|
|
|
|
|
|
|
To import all of these functions: |
|
1998
|
|
|
|
|
|
|
|
|
1999
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Dict ); |
|
2000
|
|
|
|
|
|
|
|
|
2001
|
|
|
|
|
|
|
=head2 B<Enum> |
|
2002
|
|
|
|
|
|
|
|
|
2003
|
|
|
|
|
|
|
Based on B<Enum> in L<Types::Standard>. |
|
2004
|
|
|
|
|
|
|
|
|
2005
|
|
|
|
|
|
|
The C<< Enum >> constant returns a blessed type constraint object. |
|
2006
|
|
|
|
|
|
|
C<< is_Enum($value) >> checks a value against the type and returns a boolean. |
|
2007
|
|
|
|
|
|
|
C<< assert_Enum($value) >> checks a value against the type and throws an error. |
|
2008
|
|
|
|
|
|
|
|
|
2009
|
|
|
|
|
|
|
To import all of these functions: |
|
2010
|
|
|
|
|
|
|
|
|
2011
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Enum ); |
|
2012
|
|
|
|
|
|
|
|
|
2013
|
|
|
|
|
|
|
=head2 B<FaceCard> |
|
2014
|
|
|
|
|
|
|
|
|
2015
|
|
|
|
|
|
|
Based on B<FaceCard> in L<Acme::Mitey::Cards::Types::Source>. |
|
2016
|
|
|
|
|
|
|
|
|
2017
|
|
|
|
|
|
|
The C<< FaceCard >> constant returns a blessed type constraint object. |
|
2018
|
|
|
|
|
|
|
C<< is_FaceCard($value) >> checks a value against the type and returns a boolean. |
|
2019
|
|
|
|
|
|
|
C<< assert_FaceCard($value) >> checks a value against the type and throws an error. |
|
2020
|
|
|
|
|
|
|
|
|
2021
|
|
|
|
|
|
|
To import all of these functions: |
|
2022
|
|
|
|
|
|
|
|
|
2023
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :FaceCard ); |
|
2024
|
|
|
|
|
|
|
|
|
2025
|
|
|
|
|
|
|
=head2 B<FileHandle> |
|
2026
|
|
|
|
|
|
|
|
|
2027
|
|
|
|
|
|
|
Based on B<FileHandle> in L<Types::Standard>. |
|
2028
|
|
|
|
|
|
|
|
|
2029
|
|
|
|
|
|
|
The C<< FileHandle >> constant returns a blessed type constraint object. |
|
2030
|
|
|
|
|
|
|
C<< is_FileHandle($value) >> checks a value against the type and returns a boolean. |
|
2031
|
|
|
|
|
|
|
C<< assert_FileHandle($value) >> checks a value against the type and throws an error. |
|
2032
|
|
|
|
|
|
|
|
|
2033
|
|
|
|
|
|
|
To import all of these functions: |
|
2034
|
|
|
|
|
|
|
|
|
2035
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :FileHandle ); |
|
2036
|
|
|
|
|
|
|
|
|
2037
|
|
|
|
|
|
|
=head2 B<GlobRef> |
|
2038
|
|
|
|
|
|
|
|
|
2039
|
|
|
|
|
|
|
Based on B<GlobRef> in L<Types::Standard>. |
|
2040
|
|
|
|
|
|
|
|
|
2041
|
|
|
|
|
|
|
The C<< GlobRef >> constant returns a blessed type constraint object. |
|
2042
|
|
|
|
|
|
|
C<< is_GlobRef($value) >> checks a value against the type and returns a boolean. |
|
2043
|
|
|
|
|
|
|
C<< assert_GlobRef($value) >> checks a value against the type and throws an error. |
|
2044
|
|
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
|
To import all of these functions: |
|
2046
|
|
|
|
|
|
|
|
|
2047
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :GlobRef ); |
|
2048
|
|
|
|
|
|
|
|
|
2049
|
|
|
|
|
|
|
=head2 B<Hand> |
|
2050
|
|
|
|
|
|
|
|
|
2051
|
|
|
|
|
|
|
Based on B<Hand> in L<Acme::Mitey::Cards::Types::Source>. |
|
2052
|
|
|
|
|
|
|
|
|
2053
|
|
|
|
|
|
|
The C<< Hand >> constant returns a blessed type constraint object. |
|
2054
|
|
|
|
|
|
|
C<< is_Hand($value) >> checks a value against the type and returns a boolean. |
|
2055
|
|
|
|
|
|
|
C<< assert_Hand($value) >> checks a value against the type and throws an error. |
|
2056
|
|
|
|
|
|
|
|
|
2057
|
|
|
|
|
|
|
To import all of these functions: |
|
2058
|
|
|
|
|
|
|
|
|
2059
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Hand ); |
|
2060
|
|
|
|
|
|
|
|
|
2061
|
|
|
|
|
|
|
=head2 B<HasMethods> |
|
2062
|
|
|
|
|
|
|
|
|
2063
|
|
|
|
|
|
|
Based on B<HasMethods> in L<Types::Standard>. |
|
2064
|
|
|
|
|
|
|
|
|
2065
|
|
|
|
|
|
|
The C<< HasMethods >> constant returns a blessed type constraint object. |
|
2066
|
|
|
|
|
|
|
C<< is_HasMethods($value) >> checks a value against the type and returns a boolean. |
|
2067
|
|
|
|
|
|
|
C<< assert_HasMethods($value) >> checks a value against the type and throws an error. |
|
2068
|
|
|
|
|
|
|
|
|
2069
|
|
|
|
|
|
|
To import all of these functions: |
|
2070
|
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :HasMethods ); |
|
2072
|
|
|
|
|
|
|
|
|
2073
|
|
|
|
|
|
|
=head2 B<HashRef> |
|
2074
|
|
|
|
|
|
|
|
|
2075
|
|
|
|
|
|
|
Based on B<HashRef> in L<Types::Standard>. |
|
2076
|
|
|
|
|
|
|
|
|
2077
|
|
|
|
|
|
|
The C<< HashRef >> constant returns a blessed type constraint object. |
|
2078
|
|
|
|
|
|
|
C<< is_HashRef($value) >> checks a value against the type and returns a boolean. |
|
2079
|
|
|
|
|
|
|
C<< assert_HashRef($value) >> checks a value against the type and throws an error. |
|
2080
|
|
|
|
|
|
|
|
|
2081
|
|
|
|
|
|
|
To import all of these functions: |
|
2082
|
|
|
|
|
|
|
|
|
2083
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :HashRef ); |
|
2084
|
|
|
|
|
|
|
|
|
2085
|
|
|
|
|
|
|
=head2 B<InstanceOf> |
|
2086
|
|
|
|
|
|
|
|
|
2087
|
|
|
|
|
|
|
Based on B<InstanceOf> in L<Types::Standard>. |
|
2088
|
|
|
|
|
|
|
|
|
2089
|
|
|
|
|
|
|
The C<< InstanceOf >> constant returns a blessed type constraint object. |
|
2090
|
|
|
|
|
|
|
C<< is_InstanceOf($value) >> checks a value against the type and returns a boolean. |
|
2091
|
|
|
|
|
|
|
C<< assert_InstanceOf($value) >> checks a value against the type and throws an error. |
|
2092
|
|
|
|
|
|
|
|
|
2093
|
|
|
|
|
|
|
To import all of these functions: |
|
2094
|
|
|
|
|
|
|
|
|
2095
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :InstanceOf ); |
|
2096
|
|
|
|
|
|
|
|
|
2097
|
|
|
|
|
|
|
=head2 B<Int> |
|
2098
|
|
|
|
|
|
|
|
|
2099
|
|
|
|
|
|
|
Based on B<Int> in L<Types::Standard>. |
|
2100
|
|
|
|
|
|
|
|
|
2101
|
|
|
|
|
|
|
The C<< Int >> constant returns a blessed type constraint object. |
|
2102
|
|
|
|
|
|
|
C<< is_Int($value) >> checks a value against the type and returns a boolean. |
|
2103
|
|
|
|
|
|
|
C<< assert_Int($value) >> checks a value against the type and throws an error. |
|
2104
|
|
|
|
|
|
|
|
|
2105
|
|
|
|
|
|
|
To import all of these functions: |
|
2106
|
|
|
|
|
|
|
|
|
2107
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Int ); |
|
2108
|
|
|
|
|
|
|
|
|
2109
|
|
|
|
|
|
|
=head2 B<IntRange> |
|
2110
|
|
|
|
|
|
|
|
|
2111
|
|
|
|
|
|
|
Based on B<IntRange> in L<Types::Common::Numeric>. |
|
2112
|
|
|
|
|
|
|
|
|
2113
|
|
|
|
|
|
|
The C<< IntRange >> constant returns a blessed type constraint object. |
|
2114
|
|
|
|
|
|
|
C<< is_IntRange($value) >> checks a value against the type and returns a boolean. |
|
2115
|
|
|
|
|
|
|
C<< assert_IntRange($value) >> checks a value against the type and throws an error. |
|
2116
|
|
|
|
|
|
|
|
|
2117
|
|
|
|
|
|
|
To import all of these functions: |
|
2118
|
|
|
|
|
|
|
|
|
2119
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :IntRange ); |
|
2120
|
|
|
|
|
|
|
|
|
2121
|
|
|
|
|
|
|
=head2 B<Item> |
|
2122
|
|
|
|
|
|
|
|
|
2123
|
|
|
|
|
|
|
Based on B<Item> in L<Types::Standard>. |
|
2124
|
|
|
|
|
|
|
|
|
2125
|
|
|
|
|
|
|
The C<< Item >> constant returns a blessed type constraint object. |
|
2126
|
|
|
|
|
|
|
C<< is_Item($value) >> checks a value against the type and returns a boolean. |
|
2127
|
|
|
|
|
|
|
C<< assert_Item($value) >> checks a value against the type and throws an error. |
|
2128
|
|
|
|
|
|
|
|
|
2129
|
|
|
|
|
|
|
To import all of these functions: |
|
2130
|
|
|
|
|
|
|
|
|
2131
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Item ); |
|
2132
|
|
|
|
|
|
|
|
|
2133
|
|
|
|
|
|
|
=head2 B<JokerCard> |
|
2134
|
|
|
|
|
|
|
|
|
2135
|
|
|
|
|
|
|
Based on B<JokerCard> in L<Acme::Mitey::Cards::Types::Source>. |
|
2136
|
|
|
|
|
|
|
|
|
2137
|
|
|
|
|
|
|
The C<< JokerCard >> constant returns a blessed type constraint object. |
|
2138
|
|
|
|
|
|
|
C<< is_JokerCard($value) >> checks a value against the type and returns a boolean. |
|
2139
|
|
|
|
|
|
|
C<< assert_JokerCard($value) >> checks a value against the type and throws an error. |
|
2140
|
|
|
|
|
|
|
|
|
2141
|
|
|
|
|
|
|
To import all of these functions: |
|
2142
|
|
|
|
|
|
|
|
|
2143
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :JokerCard ); |
|
2144
|
|
|
|
|
|
|
|
|
2145
|
|
|
|
|
|
|
=head2 B<LaxNum> |
|
2146
|
|
|
|
|
|
|
|
|
2147
|
|
|
|
|
|
|
Based on B<LaxNum> in L<Types::Standard>. |
|
2148
|
|
|
|
|
|
|
|
|
2149
|
|
|
|
|
|
|
The C<< LaxNum >> constant returns a blessed type constraint object. |
|
2150
|
|
|
|
|
|
|
C<< is_LaxNum($value) >> checks a value against the type and returns a boolean. |
|
2151
|
|
|
|
|
|
|
C<< assert_LaxNum($value) >> checks a value against the type and throws an error. |
|
2152
|
|
|
|
|
|
|
|
|
2153
|
|
|
|
|
|
|
To import all of these functions: |
|
2154
|
|
|
|
|
|
|
|
|
2155
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :LaxNum ); |
|
2156
|
|
|
|
|
|
|
|
|
2157
|
|
|
|
|
|
|
=head2 B<LowerCaseSimpleStr> |
|
2158
|
|
|
|
|
|
|
|
|
2159
|
|
|
|
|
|
|
Based on B<LowerCaseSimpleStr> in L<Types::Common::String>. |
|
2160
|
|
|
|
|
|
|
|
|
2161
|
|
|
|
|
|
|
The C<< LowerCaseSimpleStr >> constant returns a blessed type constraint object. |
|
2162
|
|
|
|
|
|
|
C<< is_LowerCaseSimpleStr($value) >> checks a value against the type and returns a boolean. |
|
2163
|
|
|
|
|
|
|
C<< assert_LowerCaseSimpleStr($value) >> checks a value against the type and throws an error. |
|
2164
|
|
|
|
|
|
|
|
|
2165
|
|
|
|
|
|
|
To import all of these functions: |
|
2166
|
|
|
|
|
|
|
|
|
2167
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :LowerCaseSimpleStr ); |
|
2168
|
|
|
|
|
|
|
|
|
2169
|
|
|
|
|
|
|
=head2 B<LowerCaseStr> |
|
2170
|
|
|
|
|
|
|
|
|
2171
|
|
|
|
|
|
|
Based on B<LowerCaseStr> in L<Types::Common::String>. |
|
2172
|
|
|
|
|
|
|
|
|
2173
|
|
|
|
|
|
|
The C<< LowerCaseStr >> constant returns a blessed type constraint object. |
|
2174
|
|
|
|
|
|
|
C<< is_LowerCaseStr($value) >> checks a value against the type and returns a boolean. |
|
2175
|
|
|
|
|
|
|
C<< assert_LowerCaseStr($value) >> checks a value against the type and throws an error. |
|
2176
|
|
|
|
|
|
|
|
|
2177
|
|
|
|
|
|
|
To import all of these functions: |
|
2178
|
|
|
|
|
|
|
|
|
2179
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :LowerCaseStr ); |
|
2180
|
|
|
|
|
|
|
|
|
2181
|
|
|
|
|
|
|
=head2 B<Map> |
|
2182
|
|
|
|
|
|
|
|
|
2183
|
|
|
|
|
|
|
Based on B<Map> in L<Types::Standard>. |
|
2184
|
|
|
|
|
|
|
|
|
2185
|
|
|
|
|
|
|
The C<< Map >> constant returns a blessed type constraint object. |
|
2186
|
|
|
|
|
|
|
C<< is_Map($value) >> checks a value against the type and returns a boolean. |
|
2187
|
|
|
|
|
|
|
C<< assert_Map($value) >> checks a value against the type and throws an error. |
|
2188
|
|
|
|
|
|
|
|
|
2189
|
|
|
|
|
|
|
To import all of these functions: |
|
2190
|
|
|
|
|
|
|
|
|
2191
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Map ); |
|
2192
|
|
|
|
|
|
|
|
|
2193
|
|
|
|
|
|
|
=head2 B<Maybe> |
|
2194
|
|
|
|
|
|
|
|
|
2195
|
|
|
|
|
|
|
Based on B<Maybe> in L<Types::Standard>. |
|
2196
|
|
|
|
|
|
|
|
|
2197
|
|
|
|
|
|
|
The C<< Maybe >> constant returns a blessed type constraint object. |
|
2198
|
|
|
|
|
|
|
C<< is_Maybe($value) >> checks a value against the type and returns a boolean. |
|
2199
|
|
|
|
|
|
|
C<< assert_Maybe($value) >> checks a value against the type and throws an error. |
|
2200
|
|
|
|
|
|
|
|
|
2201
|
|
|
|
|
|
|
To import all of these functions: |
|
2202
|
|
|
|
|
|
|
|
|
2203
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Maybe ); |
|
2204
|
|
|
|
|
|
|
|
|
2205
|
|
|
|
|
|
|
=head2 B<NegativeInt> |
|
2206
|
|
|
|
|
|
|
|
|
2207
|
|
|
|
|
|
|
Based on B<NegativeInt> in L<Types::Common::Numeric>. |
|
2208
|
|
|
|
|
|
|
|
|
2209
|
|
|
|
|
|
|
The C<< NegativeInt >> constant returns a blessed type constraint object. |
|
2210
|
|
|
|
|
|
|
C<< is_NegativeInt($value) >> checks a value against the type and returns a boolean. |
|
2211
|
|
|
|
|
|
|
C<< assert_NegativeInt($value) >> checks a value against the type and throws an error. |
|
2212
|
|
|
|
|
|
|
|
|
2213
|
|
|
|
|
|
|
To import all of these functions: |
|
2214
|
|
|
|
|
|
|
|
|
2215
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NegativeInt ); |
|
2216
|
|
|
|
|
|
|
|
|
2217
|
|
|
|
|
|
|
=head2 B<NegativeNum> |
|
2218
|
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
Based on B<NegativeNum> in L<Types::Common::Numeric>. |
|
2220
|
|
|
|
|
|
|
|
|
2221
|
|
|
|
|
|
|
The C<< NegativeNum >> constant returns a blessed type constraint object. |
|
2222
|
|
|
|
|
|
|
C<< is_NegativeNum($value) >> checks a value against the type and returns a boolean. |
|
2223
|
|
|
|
|
|
|
C<< assert_NegativeNum($value) >> checks a value against the type and throws an error. |
|
2224
|
|
|
|
|
|
|
|
|
2225
|
|
|
|
|
|
|
To import all of these functions: |
|
2226
|
|
|
|
|
|
|
|
|
2227
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NegativeNum ); |
|
2228
|
|
|
|
|
|
|
|
|
2229
|
|
|
|
|
|
|
=head2 B<NegativeOrZeroInt> |
|
2230
|
|
|
|
|
|
|
|
|
2231
|
|
|
|
|
|
|
Based on B<NegativeOrZeroInt> in L<Types::Common::Numeric>. |
|
2232
|
|
|
|
|
|
|
|
|
2233
|
|
|
|
|
|
|
The C<< NegativeOrZeroInt >> constant returns a blessed type constraint object. |
|
2234
|
|
|
|
|
|
|
C<< is_NegativeOrZeroInt($value) >> checks a value against the type and returns a boolean. |
|
2235
|
|
|
|
|
|
|
C<< assert_NegativeOrZeroInt($value) >> checks a value against the type and throws an error. |
|
2236
|
|
|
|
|
|
|
|
|
2237
|
|
|
|
|
|
|
To import all of these functions: |
|
2238
|
|
|
|
|
|
|
|
|
2239
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NegativeOrZeroInt ); |
|
2240
|
|
|
|
|
|
|
|
|
2241
|
|
|
|
|
|
|
=head2 B<NegativeOrZeroNum> |
|
2242
|
|
|
|
|
|
|
|
|
2243
|
|
|
|
|
|
|
Based on B<NegativeOrZeroNum> in L<Types::Common::Numeric>. |
|
2244
|
|
|
|
|
|
|
|
|
2245
|
|
|
|
|
|
|
The C<< NegativeOrZeroNum >> constant returns a blessed type constraint object. |
|
2246
|
|
|
|
|
|
|
C<< is_NegativeOrZeroNum($value) >> checks a value against the type and returns a boolean. |
|
2247
|
|
|
|
|
|
|
C<< assert_NegativeOrZeroNum($value) >> checks a value against the type and throws an error. |
|
2248
|
|
|
|
|
|
|
|
|
2249
|
|
|
|
|
|
|
To import all of these functions: |
|
2250
|
|
|
|
|
|
|
|
|
2251
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NegativeOrZeroNum ); |
|
2252
|
|
|
|
|
|
|
|
|
2253
|
|
|
|
|
|
|
=head2 B<NonEmptySimpleStr> |
|
2254
|
|
|
|
|
|
|
|
|
2255
|
|
|
|
|
|
|
Based on B<NonEmptySimpleStr> in L<Types::Common::String>. |
|
2256
|
|
|
|
|
|
|
|
|
2257
|
|
|
|
|
|
|
The C<< NonEmptySimpleStr >> constant returns a blessed type constraint object. |
|
2258
|
|
|
|
|
|
|
C<< is_NonEmptySimpleStr($value) >> checks a value against the type and returns a boolean. |
|
2259
|
|
|
|
|
|
|
C<< assert_NonEmptySimpleStr($value) >> checks a value against the type and throws an error. |
|
2260
|
|
|
|
|
|
|
|
|
2261
|
|
|
|
|
|
|
To import all of these functions: |
|
2262
|
|
|
|
|
|
|
|
|
2263
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NonEmptySimpleStr ); |
|
2264
|
|
|
|
|
|
|
|
|
2265
|
|
|
|
|
|
|
=head2 B<NonEmptyStr> |
|
2266
|
|
|
|
|
|
|
|
|
2267
|
|
|
|
|
|
|
Based on B<NonEmptyStr> in L<Types::Common::String>. |
|
2268
|
|
|
|
|
|
|
|
|
2269
|
|
|
|
|
|
|
The C<< NonEmptyStr >> constant returns a blessed type constraint object. |
|
2270
|
|
|
|
|
|
|
C<< is_NonEmptyStr($value) >> checks a value against the type and returns a boolean. |
|
2271
|
|
|
|
|
|
|
C<< assert_NonEmptyStr($value) >> checks a value against the type and throws an error. |
|
2272
|
|
|
|
|
|
|
|
|
2273
|
|
|
|
|
|
|
To import all of these functions: |
|
2274
|
|
|
|
|
|
|
|
|
2275
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NonEmptyStr ); |
|
2276
|
|
|
|
|
|
|
|
|
2277
|
|
|
|
|
|
|
=head2 B<Num> |
|
2278
|
|
|
|
|
|
|
|
|
2279
|
|
|
|
|
|
|
Based on B<Num> in L<Types::Standard>. |
|
2280
|
|
|
|
|
|
|
|
|
2281
|
|
|
|
|
|
|
The C<< Num >> constant returns a blessed type constraint object. |
|
2282
|
|
|
|
|
|
|
C<< is_Num($value) >> checks a value against the type and returns a boolean. |
|
2283
|
|
|
|
|
|
|
C<< assert_Num($value) >> checks a value against the type and throws an error. |
|
2284
|
|
|
|
|
|
|
|
|
2285
|
|
|
|
|
|
|
To import all of these functions: |
|
2286
|
|
|
|
|
|
|
|
|
2287
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Num ); |
|
2288
|
|
|
|
|
|
|
|
|
2289
|
|
|
|
|
|
|
=head2 B<NumRange> |
|
2290
|
|
|
|
|
|
|
|
|
2291
|
|
|
|
|
|
|
Based on B<NumRange> in L<Types::Common::Numeric>. |
|
2292
|
|
|
|
|
|
|
|
|
2293
|
|
|
|
|
|
|
The C<< NumRange >> constant returns a blessed type constraint object. |
|
2294
|
|
|
|
|
|
|
C<< is_NumRange($value) >> checks a value against the type and returns a boolean. |
|
2295
|
|
|
|
|
|
|
C<< assert_NumRange($value) >> checks a value against the type and throws an error. |
|
2296
|
|
|
|
|
|
|
|
|
2297
|
|
|
|
|
|
|
To import all of these functions: |
|
2298
|
|
|
|
|
|
|
|
|
2299
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NumRange ); |
|
2300
|
|
|
|
|
|
|
|
|
2301
|
|
|
|
|
|
|
=head2 B<NumericCard> |
|
2302
|
|
|
|
|
|
|
|
|
2303
|
|
|
|
|
|
|
Based on B<NumericCard> in L<Acme::Mitey::Cards::Types::Source>. |
|
2304
|
|
|
|
|
|
|
|
|
2305
|
|
|
|
|
|
|
The C<< NumericCard >> constant returns a blessed type constraint object. |
|
2306
|
|
|
|
|
|
|
C<< is_NumericCard($value) >> checks a value against the type and returns a boolean. |
|
2307
|
|
|
|
|
|
|
C<< assert_NumericCard($value) >> checks a value against the type and throws an error. |
|
2308
|
|
|
|
|
|
|
|
|
2309
|
|
|
|
|
|
|
To import all of these functions: |
|
2310
|
|
|
|
|
|
|
|
|
2311
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NumericCard ); |
|
2312
|
|
|
|
|
|
|
|
|
2313
|
|
|
|
|
|
|
=head2 B<NumericCode> |
|
2314
|
|
|
|
|
|
|
|
|
2315
|
|
|
|
|
|
|
Based on B<NumericCode> in L<Types::Common::String>. |
|
2316
|
|
|
|
|
|
|
|
|
2317
|
|
|
|
|
|
|
The C<< NumericCode >> constant returns a blessed type constraint object. |
|
2318
|
|
|
|
|
|
|
C<< is_NumericCode($value) >> checks a value against the type and returns a boolean. |
|
2319
|
|
|
|
|
|
|
C<< assert_NumericCode($value) >> checks a value against the type and throws an error. |
|
2320
|
|
|
|
|
|
|
|
|
2321
|
|
|
|
|
|
|
To import all of these functions: |
|
2322
|
|
|
|
|
|
|
|
|
2323
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :NumericCode ); |
|
2324
|
|
|
|
|
|
|
|
|
2325
|
|
|
|
|
|
|
=head2 B<Object> |
|
2326
|
|
|
|
|
|
|
|
|
2327
|
|
|
|
|
|
|
Based on B<Object> in L<Types::Standard>. |
|
2328
|
|
|
|
|
|
|
|
|
2329
|
|
|
|
|
|
|
The C<< Object >> constant returns a blessed type constraint object. |
|
2330
|
|
|
|
|
|
|
C<< is_Object($value) >> checks a value against the type and returns a boolean. |
|
2331
|
|
|
|
|
|
|
C<< assert_Object($value) >> checks a value against the type and throws an error. |
|
2332
|
|
|
|
|
|
|
|
|
2333
|
|
|
|
|
|
|
To import all of these functions: |
|
2334
|
|
|
|
|
|
|
|
|
2335
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Object ); |
|
2336
|
|
|
|
|
|
|
|
|
2337
|
|
|
|
|
|
|
=head2 B<OptList> |
|
2338
|
|
|
|
|
|
|
|
|
2339
|
|
|
|
|
|
|
Based on B<OptList> in L<Types::Standard>. |
|
2340
|
|
|
|
|
|
|
|
|
2341
|
|
|
|
|
|
|
The C<< OptList >> constant returns a blessed type constraint object. |
|
2342
|
|
|
|
|
|
|
C<< is_OptList($value) >> checks a value against the type and returns a boolean. |
|
2343
|
|
|
|
|
|
|
C<< assert_OptList($value) >> checks a value against the type and throws an error. |
|
2344
|
|
|
|
|
|
|
|
|
2345
|
|
|
|
|
|
|
To import all of these functions: |
|
2346
|
|
|
|
|
|
|
|
|
2347
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :OptList ); |
|
2348
|
|
|
|
|
|
|
|
|
2349
|
|
|
|
|
|
|
=head2 B<Optional> |
|
2350
|
|
|
|
|
|
|
|
|
2351
|
|
|
|
|
|
|
Based on B<Optional> in L<Types::Standard>. |
|
2352
|
|
|
|
|
|
|
|
|
2353
|
|
|
|
|
|
|
The C<< Optional >> constant returns a blessed type constraint object. |
|
2354
|
|
|
|
|
|
|
C<< is_Optional($value) >> checks a value against the type and returns a boolean. |
|
2355
|
|
|
|
|
|
|
C<< assert_Optional($value) >> checks a value against the type and throws an error. |
|
2356
|
|
|
|
|
|
|
|
|
2357
|
|
|
|
|
|
|
To import all of these functions: |
|
2358
|
|
|
|
|
|
|
|
|
2359
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Optional ); |
|
2360
|
|
|
|
|
|
|
|
|
2361
|
|
|
|
|
|
|
=head2 B<Overload> |
|
2362
|
|
|
|
|
|
|
|
|
2363
|
|
|
|
|
|
|
Based on B<Overload> in L<Types::Standard>. |
|
2364
|
|
|
|
|
|
|
|
|
2365
|
|
|
|
|
|
|
The C<< Overload >> constant returns a blessed type constraint object. |
|
2366
|
|
|
|
|
|
|
C<< is_Overload($value) >> checks a value against the type and returns a boolean. |
|
2367
|
|
|
|
|
|
|
C<< assert_Overload($value) >> checks a value against the type and throws an error. |
|
2368
|
|
|
|
|
|
|
|
|
2369
|
|
|
|
|
|
|
To import all of these functions: |
|
2370
|
|
|
|
|
|
|
|
|
2371
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Overload ); |
|
2372
|
|
|
|
|
|
|
|
|
2373
|
|
|
|
|
|
|
=head2 B<Password> |
|
2374
|
|
|
|
|
|
|
|
|
2375
|
|
|
|
|
|
|
Based on B<Password> in L<Types::Common::String>. |
|
2376
|
|
|
|
|
|
|
|
|
2377
|
|
|
|
|
|
|
The C<< Password >> constant returns a blessed type constraint object. |
|
2378
|
|
|
|
|
|
|
C<< is_Password($value) >> checks a value against the type and returns a boolean. |
|
2379
|
|
|
|
|
|
|
C<< assert_Password($value) >> checks a value against the type and throws an error. |
|
2380
|
|
|
|
|
|
|
|
|
2381
|
|
|
|
|
|
|
To import all of these functions: |
|
2382
|
|
|
|
|
|
|
|
|
2383
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Password ); |
|
2384
|
|
|
|
|
|
|
|
|
2385
|
|
|
|
|
|
|
=head2 B<PositiveInt> |
|
2386
|
|
|
|
|
|
|
|
|
2387
|
|
|
|
|
|
|
Based on B<PositiveInt> in L<Types::Common::Numeric>. |
|
2388
|
|
|
|
|
|
|
|
|
2389
|
|
|
|
|
|
|
The C<< PositiveInt >> constant returns a blessed type constraint object. |
|
2390
|
|
|
|
|
|
|
C<< is_PositiveInt($value) >> checks a value against the type and returns a boolean. |
|
2391
|
|
|
|
|
|
|
C<< assert_PositiveInt($value) >> checks a value against the type and throws an error. |
|
2392
|
|
|
|
|
|
|
|
|
2393
|
|
|
|
|
|
|
To import all of these functions: |
|
2394
|
|
|
|
|
|
|
|
|
2395
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :PositiveInt ); |
|
2396
|
|
|
|
|
|
|
|
|
2397
|
|
|
|
|
|
|
=head2 B<PositiveNum> |
|
2398
|
|
|
|
|
|
|
|
|
2399
|
|
|
|
|
|
|
Based on B<PositiveNum> in L<Types::Common::Numeric>. |
|
2400
|
|
|
|
|
|
|
|
|
2401
|
|
|
|
|
|
|
The C<< PositiveNum >> constant returns a blessed type constraint object. |
|
2402
|
|
|
|
|
|
|
C<< is_PositiveNum($value) >> checks a value against the type and returns a boolean. |
|
2403
|
|
|
|
|
|
|
C<< assert_PositiveNum($value) >> checks a value against the type and throws an error. |
|
2404
|
|
|
|
|
|
|
|
|
2405
|
|
|
|
|
|
|
To import all of these functions: |
|
2406
|
|
|
|
|
|
|
|
|
2407
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :PositiveNum ); |
|
2408
|
|
|
|
|
|
|
|
|
2409
|
|
|
|
|
|
|
=head2 B<PositiveOrZeroInt> |
|
2410
|
|
|
|
|
|
|
|
|
2411
|
|
|
|
|
|
|
Based on B<PositiveOrZeroInt> in L<Types::Common::Numeric>. |
|
2412
|
|
|
|
|
|
|
|
|
2413
|
|
|
|
|
|
|
The C<< PositiveOrZeroInt >> constant returns a blessed type constraint object. |
|
2414
|
|
|
|
|
|
|
C<< is_PositiveOrZeroInt($value) >> checks a value against the type and returns a boolean. |
|
2415
|
|
|
|
|
|
|
C<< assert_PositiveOrZeroInt($value) >> checks a value against the type and throws an error. |
|
2416
|
|
|
|
|
|
|
|
|
2417
|
|
|
|
|
|
|
To import all of these functions: |
|
2418
|
|
|
|
|
|
|
|
|
2419
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :PositiveOrZeroInt ); |
|
2420
|
|
|
|
|
|
|
|
|
2421
|
|
|
|
|
|
|
=head2 B<PositiveOrZeroNum> |
|
2422
|
|
|
|
|
|
|
|
|
2423
|
|
|
|
|
|
|
Based on B<PositiveOrZeroNum> in L<Types::Common::Numeric>. |
|
2424
|
|
|
|
|
|
|
|
|
2425
|
|
|
|
|
|
|
The C<< PositiveOrZeroNum >> constant returns a blessed type constraint object. |
|
2426
|
|
|
|
|
|
|
C<< is_PositiveOrZeroNum($value) >> checks a value against the type and returns a boolean. |
|
2427
|
|
|
|
|
|
|
C<< assert_PositiveOrZeroNum($value) >> checks a value against the type and throws an error. |
|
2428
|
|
|
|
|
|
|
|
|
2429
|
|
|
|
|
|
|
To import all of these functions: |
|
2430
|
|
|
|
|
|
|
|
|
2431
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :PositiveOrZeroNum ); |
|
2432
|
|
|
|
|
|
|
|
|
2433
|
|
|
|
|
|
|
=head2 B<Ref> |
|
2434
|
|
|
|
|
|
|
|
|
2435
|
|
|
|
|
|
|
Based on B<Ref> in L<Types::Standard>. |
|
2436
|
|
|
|
|
|
|
|
|
2437
|
|
|
|
|
|
|
The C<< Ref >> constant returns a blessed type constraint object. |
|
2438
|
|
|
|
|
|
|
C<< is_Ref($value) >> checks a value against the type and returns a boolean. |
|
2439
|
|
|
|
|
|
|
C<< assert_Ref($value) >> checks a value against the type and throws an error. |
|
2440
|
|
|
|
|
|
|
|
|
2441
|
|
|
|
|
|
|
To import all of these functions: |
|
2442
|
|
|
|
|
|
|
|
|
2443
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Ref ); |
|
2444
|
|
|
|
|
|
|
|
|
2445
|
|
|
|
|
|
|
=head2 B<RegexpRef> |
|
2446
|
|
|
|
|
|
|
|
|
2447
|
|
|
|
|
|
|
Based on B<RegexpRef> in L<Types::Standard>. |
|
2448
|
|
|
|
|
|
|
|
|
2449
|
|
|
|
|
|
|
The C<< RegexpRef >> constant returns a blessed type constraint object. |
|
2450
|
|
|
|
|
|
|
C<< is_RegexpRef($value) >> checks a value against the type and returns a boolean. |
|
2451
|
|
|
|
|
|
|
C<< assert_RegexpRef($value) >> checks a value against the type and throws an error. |
|
2452
|
|
|
|
|
|
|
|
|
2453
|
|
|
|
|
|
|
To import all of these functions: |
|
2454
|
|
|
|
|
|
|
|
|
2455
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :RegexpRef ); |
|
2456
|
|
|
|
|
|
|
|
|
2457
|
|
|
|
|
|
|
=head2 B<RoleName> |
|
2458
|
|
|
|
|
|
|
|
|
2459
|
|
|
|
|
|
|
Based on B<RoleName> in L<Types::Standard>. |
|
2460
|
|
|
|
|
|
|
|
|
2461
|
|
|
|
|
|
|
The C<< RoleName >> constant returns a blessed type constraint object. |
|
2462
|
|
|
|
|
|
|
C<< is_RoleName($value) >> checks a value against the type and returns a boolean. |
|
2463
|
|
|
|
|
|
|
C<< assert_RoleName($value) >> checks a value against the type and throws an error. |
|
2464
|
|
|
|
|
|
|
|
|
2465
|
|
|
|
|
|
|
To import all of these functions: |
|
2466
|
|
|
|
|
|
|
|
|
2467
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :RoleName ); |
|
2468
|
|
|
|
|
|
|
|
|
2469
|
|
|
|
|
|
|
=head2 B<ScalarRef> |
|
2470
|
|
|
|
|
|
|
|
|
2471
|
|
|
|
|
|
|
Based on B<ScalarRef> in L<Types::Standard>. |
|
2472
|
|
|
|
|
|
|
|
|
2473
|
|
|
|
|
|
|
The C<< ScalarRef >> constant returns a blessed type constraint object. |
|
2474
|
|
|
|
|
|
|
C<< is_ScalarRef($value) >> checks a value against the type and returns a boolean. |
|
2475
|
|
|
|
|
|
|
C<< assert_ScalarRef($value) >> checks a value against the type and throws an error. |
|
2476
|
|
|
|
|
|
|
|
|
2477
|
|
|
|
|
|
|
To import all of these functions: |
|
2478
|
|
|
|
|
|
|
|
|
2479
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :ScalarRef ); |
|
2480
|
|
|
|
|
|
|
|
|
2481
|
|
|
|
|
|
|
=head2 B<Set> |
|
2482
|
|
|
|
|
|
|
|
|
2483
|
|
|
|
|
|
|
Based on B<Set> in L<Acme::Mitey::Cards::Types::Source>. |
|
2484
|
|
|
|
|
|
|
|
|
2485
|
|
|
|
|
|
|
The C<< Set >> constant returns a blessed type constraint object. |
|
2486
|
|
|
|
|
|
|
C<< is_Set($value) >> checks a value against the type and returns a boolean. |
|
2487
|
|
|
|
|
|
|
C<< assert_Set($value) >> checks a value against the type and throws an error. |
|
2488
|
|
|
|
|
|
|
|
|
2489
|
|
|
|
|
|
|
To import all of these functions: |
|
2490
|
|
|
|
|
|
|
|
|
2491
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Set ); |
|
2492
|
|
|
|
|
|
|
|
|
2493
|
|
|
|
|
|
|
=head2 B<SimpleStr> |
|
2494
|
|
|
|
|
|
|
|
|
2495
|
|
|
|
|
|
|
Based on B<SimpleStr> in L<Types::Common::String>. |
|
2496
|
|
|
|
|
|
|
|
|
2497
|
|
|
|
|
|
|
The C<< SimpleStr >> constant returns a blessed type constraint object. |
|
2498
|
|
|
|
|
|
|
C<< is_SimpleStr($value) >> checks a value against the type and returns a boolean. |
|
2499
|
|
|
|
|
|
|
C<< assert_SimpleStr($value) >> checks a value against the type and throws an error. |
|
2500
|
|
|
|
|
|
|
|
|
2501
|
|
|
|
|
|
|
To import all of these functions: |
|
2502
|
|
|
|
|
|
|
|
|
2503
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :SimpleStr ); |
|
2504
|
|
|
|
|
|
|
|
|
2505
|
|
|
|
|
|
|
=head2 B<SingleDigit> |
|
2506
|
|
|
|
|
|
|
|
|
2507
|
|
|
|
|
|
|
Based on B<SingleDigit> in L<Types::Common::Numeric>. |
|
2508
|
|
|
|
|
|
|
|
|
2509
|
|
|
|
|
|
|
The C<< SingleDigit >> constant returns a blessed type constraint object. |
|
2510
|
|
|
|
|
|
|
C<< is_SingleDigit($value) >> checks a value against the type and returns a boolean. |
|
2511
|
|
|
|
|
|
|
C<< assert_SingleDigit($value) >> checks a value against the type and throws an error. |
|
2512
|
|
|
|
|
|
|
|
|
2513
|
|
|
|
|
|
|
To import all of these functions: |
|
2514
|
|
|
|
|
|
|
|
|
2515
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :SingleDigit ); |
|
2516
|
|
|
|
|
|
|
|
|
2517
|
|
|
|
|
|
|
=head2 B<Slurpy> |
|
2518
|
|
|
|
|
|
|
|
|
2519
|
|
|
|
|
|
|
Based on B<Slurpy> in L<Types::Standard>. |
|
2520
|
|
|
|
|
|
|
|
|
2521
|
|
|
|
|
|
|
The C<< Slurpy >> constant returns a blessed type constraint object. |
|
2522
|
|
|
|
|
|
|
C<< is_Slurpy($value) >> checks a value against the type and returns a boolean. |
|
2523
|
|
|
|
|
|
|
C<< assert_Slurpy($value) >> checks a value against the type and throws an error. |
|
2524
|
|
|
|
|
|
|
|
|
2525
|
|
|
|
|
|
|
To import all of these functions: |
|
2526
|
|
|
|
|
|
|
|
|
2527
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Slurpy ); |
|
2528
|
|
|
|
|
|
|
|
|
2529
|
|
|
|
|
|
|
=head2 B<Str> |
|
2530
|
|
|
|
|
|
|
|
|
2531
|
|
|
|
|
|
|
Based on B<Str> in L<Types::Standard>. |
|
2532
|
|
|
|
|
|
|
|
|
2533
|
|
|
|
|
|
|
The C<< Str >> constant returns a blessed type constraint object. |
|
2534
|
|
|
|
|
|
|
C<< is_Str($value) >> checks a value against the type and returns a boolean. |
|
2535
|
|
|
|
|
|
|
C<< assert_Str($value) >> checks a value against the type and throws an error. |
|
2536
|
|
|
|
|
|
|
|
|
2537
|
|
|
|
|
|
|
To import all of these functions: |
|
2538
|
|
|
|
|
|
|
|
|
2539
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Str ); |
|
2540
|
|
|
|
|
|
|
|
|
2541
|
|
|
|
|
|
|
=head2 B<StrLength> |
|
2542
|
|
|
|
|
|
|
|
|
2543
|
|
|
|
|
|
|
Based on B<StrLength> in L<Types::Common::String>. |
|
2544
|
|
|
|
|
|
|
|
|
2545
|
|
|
|
|
|
|
The C<< StrLength >> constant returns a blessed type constraint object. |
|
2546
|
|
|
|
|
|
|
C<< is_StrLength($value) >> checks a value against the type and returns a boolean. |
|
2547
|
|
|
|
|
|
|
C<< assert_StrLength($value) >> checks a value against the type and throws an error. |
|
2548
|
|
|
|
|
|
|
|
|
2549
|
|
|
|
|
|
|
To import all of these functions: |
|
2550
|
|
|
|
|
|
|
|
|
2551
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :StrLength ); |
|
2552
|
|
|
|
|
|
|
|
|
2553
|
|
|
|
|
|
|
=head2 B<StrMatch> |
|
2554
|
|
|
|
|
|
|
|
|
2555
|
|
|
|
|
|
|
Based on B<StrMatch> in L<Types::Standard>. |
|
2556
|
|
|
|
|
|
|
|
|
2557
|
|
|
|
|
|
|
The C<< StrMatch >> constant returns a blessed type constraint object. |
|
2558
|
|
|
|
|
|
|
C<< is_StrMatch($value) >> checks a value against the type and returns a boolean. |
|
2559
|
|
|
|
|
|
|
C<< assert_StrMatch($value) >> checks a value against the type and throws an error. |
|
2560
|
|
|
|
|
|
|
|
|
2561
|
|
|
|
|
|
|
To import all of these functions: |
|
2562
|
|
|
|
|
|
|
|
|
2563
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :StrMatch ); |
|
2564
|
|
|
|
|
|
|
|
|
2565
|
|
|
|
|
|
|
=head2 B<StrictNum> |
|
2566
|
|
|
|
|
|
|
|
|
2567
|
|
|
|
|
|
|
Based on B<StrictNum> in L<Types::Standard>. |
|
2568
|
|
|
|
|
|
|
|
|
2569
|
|
|
|
|
|
|
The C<< StrictNum >> constant returns a blessed type constraint object. |
|
2570
|
|
|
|
|
|
|
C<< is_StrictNum($value) >> checks a value against the type and returns a boolean. |
|
2571
|
|
|
|
|
|
|
C<< assert_StrictNum($value) >> checks a value against the type and throws an error. |
|
2572
|
|
|
|
|
|
|
|
|
2573
|
|
|
|
|
|
|
To import all of these functions: |
|
2574
|
|
|
|
|
|
|
|
|
2575
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :StrictNum ); |
|
2576
|
|
|
|
|
|
|
|
|
2577
|
|
|
|
|
|
|
=head2 B<StrongPassword> |
|
2578
|
|
|
|
|
|
|
|
|
2579
|
|
|
|
|
|
|
Based on B<StrongPassword> in L<Types::Common::String>. |
|
2580
|
|
|
|
|
|
|
|
|
2581
|
|
|
|
|
|
|
The C<< StrongPassword >> constant returns a blessed type constraint object. |
|
2582
|
|
|
|
|
|
|
C<< is_StrongPassword($value) >> checks a value against the type and returns a boolean. |
|
2583
|
|
|
|
|
|
|
C<< assert_StrongPassword($value) >> checks a value against the type and throws an error. |
|
2584
|
|
|
|
|
|
|
|
|
2585
|
|
|
|
|
|
|
To import all of these functions: |
|
2586
|
|
|
|
|
|
|
|
|
2587
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :StrongPassword ); |
|
2588
|
|
|
|
|
|
|
|
|
2589
|
|
|
|
|
|
|
=head2 B<Suit> |
|
2590
|
|
|
|
|
|
|
|
|
2591
|
|
|
|
|
|
|
Based on B<Suit> in L<Acme::Mitey::Cards::Types::Source>. |
|
2592
|
|
|
|
|
|
|
|
|
2593
|
|
|
|
|
|
|
The C<< Suit >> constant returns a blessed type constraint object. |
|
2594
|
|
|
|
|
|
|
C<< is_Suit($value) >> checks a value against the type and returns a boolean. |
|
2595
|
|
|
|
|
|
|
C<< assert_Suit($value) >> checks a value against the type and throws an error. |
|
2596
|
|
|
|
|
|
|
|
|
2597
|
|
|
|
|
|
|
To import all of these functions: |
|
2598
|
|
|
|
|
|
|
|
|
2599
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Suit ); |
|
2600
|
|
|
|
|
|
|
|
|
2601
|
|
|
|
|
|
|
=head2 B<Tied> |
|
2602
|
|
|
|
|
|
|
|
|
2603
|
|
|
|
|
|
|
Based on B<Tied> in L<Types::Standard>. |
|
2604
|
|
|
|
|
|
|
|
|
2605
|
|
|
|
|
|
|
The C<< Tied >> constant returns a blessed type constraint object. |
|
2606
|
|
|
|
|
|
|
C<< is_Tied($value) >> checks a value against the type and returns a boolean. |
|
2607
|
|
|
|
|
|
|
C<< assert_Tied($value) >> checks a value against the type and throws an error. |
|
2608
|
|
|
|
|
|
|
|
|
2609
|
|
|
|
|
|
|
To import all of these functions: |
|
2610
|
|
|
|
|
|
|
|
|
2611
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Tied ); |
|
2612
|
|
|
|
|
|
|
|
|
2613
|
|
|
|
|
|
|
=head2 B<Tuple> |
|
2614
|
|
|
|
|
|
|
|
|
2615
|
|
|
|
|
|
|
Based on B<Tuple> in L<Types::Standard>. |
|
2616
|
|
|
|
|
|
|
|
|
2617
|
|
|
|
|
|
|
The C<< Tuple >> constant returns a blessed type constraint object. |
|
2618
|
|
|
|
|
|
|
C<< is_Tuple($value) >> checks a value against the type and returns a boolean. |
|
2619
|
|
|
|
|
|
|
C<< assert_Tuple($value) >> checks a value against the type and throws an error. |
|
2620
|
|
|
|
|
|
|
|
|
2621
|
|
|
|
|
|
|
To import all of these functions: |
|
2622
|
|
|
|
|
|
|
|
|
2623
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Tuple ); |
|
2624
|
|
|
|
|
|
|
|
|
2625
|
|
|
|
|
|
|
=head2 B<Undef> |
|
2626
|
|
|
|
|
|
|
|
|
2627
|
|
|
|
|
|
|
Based on B<Undef> in L<Types::Standard>. |
|
2628
|
|
|
|
|
|
|
|
|
2629
|
|
|
|
|
|
|
The C<< Undef >> constant returns a blessed type constraint object. |
|
2630
|
|
|
|
|
|
|
C<< is_Undef($value) >> checks a value against the type and returns a boolean. |
|
2631
|
|
|
|
|
|
|
C<< assert_Undef($value) >> checks a value against the type and throws an error. |
|
2632
|
|
|
|
|
|
|
|
|
2633
|
|
|
|
|
|
|
To import all of these functions: |
|
2634
|
|
|
|
|
|
|
|
|
2635
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Undef ); |
|
2636
|
|
|
|
|
|
|
|
|
2637
|
|
|
|
|
|
|
=head2 B<UpperCaseSimpleStr> |
|
2638
|
|
|
|
|
|
|
|
|
2639
|
|
|
|
|
|
|
Based on B<UpperCaseSimpleStr> in L<Types::Common::String>. |
|
2640
|
|
|
|
|
|
|
|
|
2641
|
|
|
|
|
|
|
The C<< UpperCaseSimpleStr >> constant returns a blessed type constraint object. |
|
2642
|
|
|
|
|
|
|
C<< is_UpperCaseSimpleStr($value) >> checks a value against the type and returns a boolean. |
|
2643
|
|
|
|
|
|
|
C<< assert_UpperCaseSimpleStr($value) >> checks a value against the type and throws an error. |
|
2644
|
|
|
|
|
|
|
|
|
2645
|
|
|
|
|
|
|
To import all of these functions: |
|
2646
|
|
|
|
|
|
|
|
|
2647
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :UpperCaseSimpleStr ); |
|
2648
|
|
|
|
|
|
|
|
|
2649
|
|
|
|
|
|
|
=head2 B<UpperCaseStr> |
|
2650
|
|
|
|
|
|
|
|
|
2651
|
|
|
|
|
|
|
Based on B<UpperCaseStr> in L<Types::Common::String>. |
|
2652
|
|
|
|
|
|
|
|
|
2653
|
|
|
|
|
|
|
The C<< UpperCaseStr >> constant returns a blessed type constraint object. |
|
2654
|
|
|
|
|
|
|
C<< is_UpperCaseStr($value) >> checks a value against the type and returns a boolean. |
|
2655
|
|
|
|
|
|
|
C<< assert_UpperCaseStr($value) >> checks a value against the type and throws an error. |
|
2656
|
|
|
|
|
|
|
|
|
2657
|
|
|
|
|
|
|
To import all of these functions: |
|
2658
|
|
|
|
|
|
|
|
|
2659
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :UpperCaseStr ); |
|
2660
|
|
|
|
|
|
|
|
|
2661
|
|
|
|
|
|
|
=head2 B<Value> |
|
2662
|
|
|
|
|
|
|
|
|
2663
|
|
|
|
|
|
|
Based on B<Value> in L<Types::Standard>. |
|
2664
|
|
|
|
|
|
|
|
|
2665
|
|
|
|
|
|
|
The C<< Value >> constant returns a blessed type constraint object. |
|
2666
|
|
|
|
|
|
|
C<< is_Value($value) >> checks a value against the type and returns a boolean. |
|
2667
|
|
|
|
|
|
|
C<< assert_Value($value) >> checks a value against the type and throws an error. |
|
2668
|
|
|
|
|
|
|
|
|
2669
|
|
|
|
|
|
|
To import all of these functions: |
|
2670
|
|
|
|
|
|
|
|
|
2671
|
|
|
|
|
|
|
use Acme::Mitey::Cards::Types qw( :Value ); |
|
2672
|
|
|
|
|
|
|
|
|
2673
|
|
|
|
|
|
|
=head1 TYPE CONSTRAINT METHODS |
|
2674
|
|
|
|
|
|
|
|
|
2675
|
|
|
|
|
|
|
For any type constraint B<Foo> the following methods are available: |
|
2676
|
|
|
|
|
|
|
|
|
2677
|
|
|
|
|
|
|
Foo->check( $value ) # boolean |
|
2678
|
|
|
|
|
|
|
Foo->get_message( $value ) # error message, even if $value is ok |
|
2679
|
|
|
|
|
|
|
Foo->validate( $value ) # error message, or undef if ok |
|
2680
|
|
|
|
|
|
|
Foo->assert_valid( $value ) # returns true, dies if error |
|
2681
|
|
|
|
|
|
|
Foo->assert_return( $value ) # returns $value, or dies if error |
|
2682
|
|
|
|
|
|
|
Foo->to_TypeTiny # promotes the object to Type::Tiny |
|
2683
|
|
|
|
|
|
|
|
|
2684
|
|
|
|
|
|
|
Objects overload stringification to return their name and overload |
|
2685
|
|
|
|
|
|
|
coderefification to call C<assert_return>. |
|
2686
|
|
|
|
|
|
|
|
|
2687
|
|
|
|
|
|
|
The objects as-is can be used in L<Moo> or L<Mite> C<isa> options. |
|
2688
|
|
|
|
|
|
|
|
|
2689
|
|
|
|
|
|
|
has myattr => ( |
|
2690
|
|
|
|
|
|
|
is => 'rw', |
|
2691
|
|
|
|
|
|
|
isa => Foo, |
|
2692
|
|
|
|
|
|
|
); |
|
2693
|
|
|
|
|
|
|
|
|
2694
|
|
|
|
|
|
|
They cannot be used as-is in L<Moose> or L<Mouse>, but can be promoted |
|
2695
|
|
|
|
|
|
|
to Type::Tiny and will then work: |
|
2696
|
|
|
|
|
|
|
|
|
2697
|
|
|
|
|
|
|
has myattr => ( |
|
2698
|
|
|
|
|
|
|
is => 'rw', |
|
2699
|
|
|
|
|
|
|
isa => Foo->to_TypeTiny, |
|
2700
|
|
|
|
|
|
|
); |
|
2701
|
|
|
|
|
|
|
|
|
2702
|
|
|
|
|
|
|
=cut |
|
2703
|
|
|
|
|
|
|
|