bump version to 0.26
[gitmo/MooseX-Types.git] / lib / MooseX / Types / Moose.pm
CommitLineData
52d358e2 1package MooseX::Types::Moose;
6a1db9c7 2our $VERSION = "0.26";
e211870f 3
4=head1 NAME
5
52d358e2 6MooseX::Types::Moose - Types shipped with L<Moose>
e211870f 7
8=cut
9
8af0a70d 10use warnings;
11use strict;
12
52d358e2 13use MooseX::Types;
8af0a70d 14use Moose::Util::TypeConstraints ();
9616cebc 15
16use namespace::clean -except => [qw( meta )];
8af0a70d 17
e211870f 18=head1 SYNOPSIS
19
20 package Foo;
21 use Moose;
52d358e2 22 use MooseX::Types::Moose qw( Int Str );
e211870f 23 use Carp qw( croak );
24
25 has 'name',
26 is => 'rw',
27 isa => Str;
28
29 has 'id',
30 is => 'rw',
31 isa => Int;
32
33 sub add {
34 my ($self, $x, $y) = @_;
35 croak 'First arg not an Int' unless is_Int($x);
36 croak 'Second arg not an Int' unless is_Int($y);
37 return $x + $y;
38 }
39
40 1;
41
42=head1 DESCRIPTION
43
52d358e2 44This package contains a virtual library for L<MooseX::Types> that
45is able to export all types known to L<Moose>. See L<MooseX::Types>
e211870f 46for general usage information.
47
48=cut
49
8af0a70d 50# all available builtin types as short and long name
51my %BuiltIn_Storage
52 = map { ($_) x 2 }
e9c7cea8 53 Moose::Util::TypeConstraints->list_all_builtin_type_constraints;
8af0a70d 54
e211870f 55=head1 METHODS
56
57=head2 type_storage
58
52d358e2 59Overrides L<MooseX::Types::Base>' C<type_storage> to provide a hash
e211870f 60reference containing all built-in L<Moose> types.
61
62=cut
63
8af0a70d 64# use prepopulated builtin hash as type storage
65sub type_storage { \%BuiltIn_Storage }
66
e211870f 67=head1 SEE ALSO
68
52d358e2 69L<MooseX::Types::Moose>,
e211870f 70L<Moose>,
71L<Moose::Util::TypeConstraints>
72
b55332a8 73=head1 AUTHOR
e211870f 74
b55332a8 75See L<MooseX::Types/AUTHOR>.
e211870f 76
77=head1 LICENSE
78
79This program is free software; you can redistribute it and/or modify
80it under the same terms as perl itself.
81
82=cut
83
8af0a70d 841;