From: Hans Dieter Pearcey Date: Fri, 26 Jun 2009 20:50:18 +0000 (-0400) Subject: rename to _check_associated_methods X-Git-Tag: 0.85~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9340e346153b8eb4864763575c4bc77bed27d3dd;p=gitmo%2FMoose.git rename to _check_associated_methods --- diff --git a/Changes b/Changes index 32f804a..1337cbe 100644 --- a/Changes +++ b/Changes @@ -4,7 +4,7 @@ for, noteworthy changes. 0.85 * Moose::Meta::Attribute - The warning for 'no associated methods' is now split out into the - check_associated_methods method, so that extensions can safely call + _check_associated_methods method, so that extensions can safely call 'after install_accessors => ...'. (hdp) 0.84 Fri, Jun 26, 2009 diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index b734854..48a8f17 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -560,7 +560,7 @@ sub install_accessors { return; } -sub check_associated_methods { +sub _check_associated_methods { my $self = shift; unless ( @{ $self->associated_methods } @@ -831,7 +831,7 @@ name as the attribute, and a C with the name you provided. Use 'bare' when you are deliberately not installing any methods (accessor, reader, etc.) associated with this attribute; otherwise, Moose will issue a deprecation warning when this attribute is added to a -metaclass. See L. +metaclass. =item * isa => $type @@ -1063,13 +1063,6 @@ Given a value, this method returns true if the value is valid for the attribute's type constraint. If the value is not valid, it throws an error. -=item B<< $attr->check_associated_methods >> - -This method makes sure that either an explicit C<< is => 'bare' >> was passed -to the attribute's constructor or that the attribute has at least one -associated method (reader, writer, delegation, etc.). Otherwise, it issues a -warning. - =item B<< $attr->handles >> This returns the value of the C option passed to the diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 0daeacb..1cd8021 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -250,8 +250,8 @@ sub add_attribute { $self->SUPER::add_attribute($attr); # it may be a Class::MOP::Attribute, theoretically, which doesn't have # 'bare' and doesn't implement this method - if ($attr->can('check_associated_methods')) { - $attr->check_associated_methods; + if ($attr->can('_check_associated_methods')) { + $attr->_check_associated_methods; } return $attr; }