1 package MooseX::Types::TypeDecorator;
4 use Moose::Util::TypeConstraints ();
5 use Moose::Meta::TypeConstraint ();
9 shift->type_constraint->name;
11 '&' => sub {warn 'got code context'},
16 MooseX::Types::TypeDecorator - More flexible access to a Type Constraint
20 This is a decorator object that contains an underlying type constraint. We use
21 this to control access to the type constraint and to add some features.
25 The following types are defined in this class.
27 =head2 Moose::Meta::TypeConstraint
29 Used to make sure we can properly validate incoming type constraints.
33 Moose::Util::TypeConstraints::class_type 'Moose::Meta::TypeConstraint';
35 =head2 MooseX::Types::UndefinedType
37 Used since sometimes our constraint is an unknown type.
41 Moose::Util::TypeConstraints::class_type 'MooseX::Types::UndefinedType';
45 This class defines the following attributes
47 =head2 type_constraint
49 This is the type constraint that we are delegating
53 has 'type_constraint' => (
55 isa=>'Moose::Meta::TypeConstraint|MooseX::Types::UndefinedType',
58 $_ ne 'meta' && $_ ne '(""';
61 } Moose::Meta::TypeConstraint->meta->compute_all_applicable_methods,
67 This class defines the following methods.
69 =head1 AUTHOR AND COPYRIGHT
71 John Napiorkowski (jnapiorkowski) <jjnapiork@cpan.org>
75 This program is free software; you can redistribute it and/or modify
76 it under the same terms as perl itself.