2 package Moose::Meta::TypeConstraint;
8 Moose::Meta::TypeConstraint->meta->add_attribute(
9 Class::MOP::Attribute->new('name' => (
14 Moose::Meta::TypeConstraint->meta->add_attribute(
15 Class::MOP::Attribute->new('constraint_code' => (
16 reader => 'constraint_code'
20 Moose::Meta::TypeConstraint->meta->add_attribute(
21 Class::MOP::Attribute->new('coercion_code' => (
22 reader => 'coercion_code',
23 writer => 'set_coercion_code',
24 predicate => 'has_coercion'
28 sub new { (shift)->meta->new_object(@_) }
29 sub check { (shift)->constraint_code->(@_) }
30 sub coerce { (shift)->coercion_code->(@_) }
40 Moose::Meta::TypeConstraint - The Moose Type Constraint metaobject
60 =item B<coercion_code>
62 =item B<set_coercion_code>
64 =item B<constraint_code>
72 All complex software has bugs lurking in it, and this module is no
73 exception. If you find a bug please either email me, or add the bug
78 Stevan Little E<lt>stevan@iinteractive.comE<gt>
80 =head1 COPYRIGHT AND LICENSE
82 Copyright 2006 by Infinity Interactive, Inc.
84 L<http://www.iinteractive.com>
86 This library is free software; you can redistribute it and/or modify
87 it under the same terms as Perl itself.