1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
package Scalar::Does::MooseTypes;
use strict;
use warnings;
our $AUTHORITY = 'cpan:TOBYINK';
our $VERSION = '0.203';
use base "Exporter::Tiny";
BEGIN {
my @NAMES = qw(
Any Item Undef Defined Bool Value Ref Str Num Int CodeRef RegexpRef
GlobRef FileHandle Object ClassName RoleName ScalarRef ArrayRef HashRef
);
require constant;
require Types::Standard;
constant->import(+{ map +( $_ => "Types::Standard"->get_type($_) ), @NAMES });
our @EXPORT_OK = @NAMES;
our %EXPORT_TAGS = (
constants => \@NAMES,
only_constants => \@NAMES,
);
}
1;
__END__
=head1 NAME
Scalar::Does::MooseTypes - (DEPRECATED) additional constants for Scalar::Does, inspired by the built-in Moose type constraints
=head1 SYNOPSIS
use 5.010;
use Scalar::Does qw(does);
use Scalar::Does::MooseTypes -all;
my $var = [];
if (does $var, ArrayRef) {
say "It's an arrayref!";
}
=head1 STATUS
This module is deprecated; use L<Types::Standard> instead:
use 5.010;
use Scalar::Does qw(does);
use Types::Standard qw(ArrayRef);
my $var = [];
if (does $var, ArrayRef) {
say "It's an arrayref!";
}
=head1 DESCRIPTION
=head2 Constants
=over
=item C<Any>
=item C<Item>
=item C<Bool>
=item C<Undef>
=item C<Defined>
=item C<Value>
=item C<Str>
=item C<Num>
=item C<Int>
=item C<ClassName>
=item C<RoleName>
=item C<Ref>
=item C<ScalarRef>
=item C<ArrayRef>
=item C<HashRef>
=item C<CodeRef>
=item C<RegexpRef>
=item C<GlobRef>
=item C<FileHandle>
=item C<Object>
=back
=head1 SEE ALSO
L<Types::Standard>.
L<Scalar::Does>,
L<Moose::Util::TypeConstraints>.
=head1 AUTHOR
Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
This software is copyright (c) 2012-2014, 2017 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|