Merge branch 'master' into topic/cmop-merge
[gitmo/Moose.git] / lib / Moose / Meta / TypeConstraint.pm
index 00a8a0f..989ed2b 100644 (file)
@@ -15,10 +15,6 @@ use Sub::Name qw(subname);
 
 use base qw(Class::MOP::Object);
 
-our $VERSION   = '1.17';
-$VERSION = eval $VERSION;
-our $AUTHORITY = 'cpan:STEVAN';
-
 __PACKAGE__->meta->add_attribute('name'       => (reader => 'name'));
 __PACKAGE__->meta->add_attribute('parent'     => (
     reader    => 'parent',
@@ -321,14 +317,12 @@ sub create_child_type {
 
 1;
 
+# ABSTRACT: The Moose Type Constraint metaclass
+
 __END__
 
 =pod
 
-=head1 NAME
-
-Moose::Meta::TypeConstraint - The Moose Type Constraint metaclass
-
 =head1 DESCRIPTION
 
 This class represents a single type constraint. Moose's built-in type
@@ -402,9 +396,17 @@ C<equals> and C<is_subtype_of>.
 
 =item B<< $constraint->coerce($value) >>
 
-This will attempt to coerce the value to the type. If the type does
+This will attempt to coerce the value to the type. If the type does not
 have any defined coercions this will throw an error.
 
+If no coercion can produce a value matching C<$constraint>, the original
+value is returned.
+
+=item B<< $constraint->assert_coerce($value) >>
+
+This method behaves just like C<coerce>, but if the result is not valid
+according to C<$constraint>, an error is thrown.
+
 =item B<< $constraint->check($value) >>
 
 Returns true if the given value passes the constraint for the type.
@@ -489,17 +491,4 @@ behavior and change how child types are created.
 
 See L<Moose/BUGS> for details on reporting bugs.
 
-=head1 AUTHOR
-
-Stevan Little E<lt>stevan@iinteractive.comE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2006-2010 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
 =cut