X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=1ef8a77802ce88c363afb7a19b85d9ce548a04c5;hb=d21b0c568e8f1ec9acb47482446e8ef4ab1e2906;hp=d3eaa3c027e73c53eb4978e4e1e1ac3eea5af48e;hpb=0449307510ab4425a6b340fee9bf85824eb994b1;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index d3eaa3c..1ef8a77 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -31,8 +31,12 @@ sub _process_options{ my $can_be_required = defined( $args->{init_arg} ); if(exists $args->{builder}){ + # XXX: + # Moose refuses a CODE ref builder, but Mouse doesn't for backward compatibility + # This feature will be changed in a future. (gfx) $class->throw_error('builder must be a defined scalar value which is a method name') - if ref $args->{builder} || !(defined $args->{builder}); + #if ref $args->{builder} || !defined $args->{builder}; + if !defined $args->{builder}; $can_be_required++; } @@ -374,7 +378,7 @@ __END__ =head1 NAME -Mouse::Meta::Attribute - attribute metaclass +Mouse::Meta::Attribute - The Mouse attribute metaclass =head1 METHODS @@ -482,6 +486,13 @@ is equivalent to this: =back +=head2 C<< associate_method(Method) >> + +Associates a method with the attribute. Typically, this is called internally +when an attribute generates its accessors. + +Currently the argument I is ignored in Mouse. + =head2 C<< verify_against_type_constraint(Item) -> TRUE | ERROR >> Checks that the given value passes this attribute's type constraint. Returns C @@ -496,5 +507,7 @@ Accessors and helper methods are installed. Some error checking is done. L +L + =cut