recursion test
[gitmo/MooseX-Types.git] / lib / MooseX / Types / UndefinedType.pm
CommitLineData
52d358e2 1package MooseX::Types::UndefinedType;
e211870f 2
3=head1 NAME
4
52d358e2 5MooseX::Types::UndefinedType - Represents a not yet defined type
e211870f 6
7=cut
8
9use warnings;
10use strict;
11
12use overload '""' => sub { shift->name },
13 fallback => 1;
14
15=head1 DESCRIPTION
16
17Whenever a type handle function (e.g. C<Int()> can't find a type
18constraint under it's full name, it assumes it has not yet been defined.
19It will then return an instance of this class, handling only
20stringification, name and possible identification of undefined types.
21
22=head1 METHODS
23
24=head2 new
25
26Takes a full type name as argument and returns an instance of this
27class.
28
29=cut
30
31sub new { bless { name => $_[1] }, $_[0] }
32
33=head2 name
34
35Returns the stored type name.
36
37=cut
38
39sub name { $_[0]->{name} }
40
41=head1 SEE ALSO
42
52d358e2 43L<MooseX::Types::Moose>,
e211870f 44L<Moose::Util::TypeConstraints>,
45L<Moose::Meta::TypeConstraint>
46
47=head1 AUTHOR AND COPYRIGHT
48
49Robert 'phaylon' Sedlacek C<E<lt>rs@474.atE<gt>>, with many thanks to
50the C<#moose> cabal on C<irc.perl.org>.
51
52=head1 LICENSE
53
54This program is free software; you can redistribute it and/or modify
55it under the same terms as perl itself.
56
57=cut
58
59
601;