bump version to 0.75_01
[gitmo/Moose.git] / lib / Moose / Meta / TypeCoercion / Union.pm
index 450f774..b0b1af8 100644 (file)
@@ -5,10 +5,9 @@ use strict;
 use warnings;
 use metaclass;
 
-use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.56';
+our $VERSION   = '0.75_01';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -19,8 +18,8 @@ sub compile_type_coercion {
     my $type_constraint = $self->type_constraint;
     
     (blessed $type_constraint && $type_constraint->isa('Moose::Meta::TypeConstraint::Union'))
-     || confess "You can only a Moose::Meta::TypeCoercion::Union for a " .
-                "Moose::Meta::TypeConstraint::Union, not a $type_constraint";
+     || Moose->throw_error("You can only a Moose::Meta::TypeCoercion::Union for a " .
+                "Moose::Meta::TypeConstraint::Union, not a $type_constraint");
     
     $self->_compiled_type_coercion(sub {
         my $value = shift;
@@ -44,7 +43,8 @@ sub compile_type_coercion {
 sub has_coercion_for_type { 0 }
 
 sub add_type_coercions {
-    confess "Cannot add additional type coercions to Union types";
+    require Moose;
+    Moose->throw_error("Cannot add additional type coercions to Union types");
 }
 
 1;
@@ -59,26 +59,25 @@ Moose::Meta::TypeCoercion::Union - The Moose Type Coercion metaclass for Unions
 
 =head1 DESCRIPTION
 
-For the most part, the only time you will ever encounter an 
-instance of this class is if you are doing some serious deep 
-introspection. This API should not be considered final, but 
-it is B<highly unlikely> that this will matter to a regular 
-Moose user.
-
-If you wish to use features at this depth, please come to the 
-#moose IRC channel on irc.perl.org and we can talk :)
-
+This is a subclass of L<Moose::Meta::TypeCoercion> that is used for
+L<Moose::Meta::TypeConstraint::Union> objects.
 =head1 METHODS
 
 =over 4
 
-=item B<meta>
+=item B<< $coercion->has_coercion_for_type >>
+
+This method always returns false.
+
+=item B<< $coercion->add_type_coercions >>
 
-=item B<compile_type_coercion>
+This method always throws an error. You cannot add coercions to a
+union type coercion.
 
-=item B<has_coercion_for_type>
+=item B<< $coercion->coerce($value) >>
 
-=item B<add_type_coercions>
+This method will coerce by trying the coercions for each type in the
+union.
 
 =back
 
@@ -94,7 +93,7 @@ Stevan Little E<lt>stevan@iinteractive.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2008 by Infinity Interactive, Inc.
+Copyright 2006-2009 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>