From: nperez Date: Fri, 8 May 2009 18:51:33 +0000 (-0500) Subject: Change the writer for insertion_order to include an underscore prefix X-Git-Tag: 0.84~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=943cbe2dc6895a397ba6cc20469eb26e04933472;p=gitmo%2FClass-MOP.git Change the writer for insertion_order to include an underscore prefix --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index bdc1783..e9f94f2 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -510,7 +510,7 @@ Class::MOP::Attribute->meta->add_attribute( Class::MOP::Attribute->meta->add_attribute( Class::MOP::Attribute->new('insertion_order' => ( reader => { 'insertion_order' => \&Class::MOP::Attribute::insertion_order }, - writer => { 'set_insertion_order' => \&Class::MOP::Attribute::set_insertion_order }, + writer => { '_set_insertion_order' => \&Class::MOP::Attribute::_set_insertion_order }, predicate => { 'has_insertion_order' => \&Class::MOP::Attribute::has_insertion_order }, )) ); diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm index 6d907ea..e6e9b77 100644 --- a/lib/Class/MOP/Attribute.pm +++ b/lib/Class/MOP/Attribute.pm @@ -179,7 +179,7 @@ sub init_arg { $_[0]->{'init_arg'} } sub initializer { $_[0]->{'initializer'} } sub definition_context { $_[0]->{'definition_context'} } sub insertion_order { $_[0]->{'insertion_order'} } -sub set_insertion_order { $_[0]->{'insertion_order'} = $_[1] } +sub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] } # end bootstrapped away method section. # (all methods below here are kept intact) diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index a720d17..41fc059 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -831,7 +831,7 @@ sub add_attribute { # get our count of previously inserted attributes and # increment by one so this attribute knows its order my $order = (scalar keys %{$self->get_attribute_map}) - 1; - $attribute->set_insertion_order($order + 1); + $attribute->_set_insertion_order($order + 1); # then onto installing the new accessors $self->get_attribute_map->{$attribute->name} = $attribute;