X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute.pm;h=56f3bc90b43ffd0ce47748d09ff9caa9079c6d03;hb=9f4682583eaf20565077ca8e95ba55a9cb6496a2;hp=9989d75d2ee74e5b6a103feeee09d64c769db17d;hpb=12b0a10348ad2e1a52db92047487e7374cbe28c2;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 9989d75..56f3bc9 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -648,8 +648,7 @@ sub _inline_check_required { return ( 'if (@_ < 2) {', $self->_inline_throw_error( - '"Attribute (' . $attr_name . ') is required, so cannot ' - . 'be set to undef"' # defined $_[1] is not good enough + '"Attribute (' . $attr_name . ') is required"' ) . ';', '}', ); @@ -1307,7 +1306,7 @@ L and add Moose specific features. =over 4 -=item B<< Moose::Meta::Attribute->new(%options) >> +=item B<< Moose::Meta::Attribute->new($name, %options) >> This method overrides the L constructor. @@ -1475,14 +1474,14 @@ I Before setting the value, a check is made on the type constraint of the attribute, if it has one, to see if the value passes it. If the -value fails to pass, the set operation dies with a L. +value fails to pass, the set operation dies. Any coercion to convert values is done before checking the type constraint. To check a value against a type constraint before setting it, fetch the attribute instance using L, fetch the type_constraint from the attribute using L -and call L. See L +and call L. See L for an example. =back