Moose::Meta::Role::rename_attribute

[email protected] ("Christopher Brown")
Newsgroups perl.moose
Message-ID <[email protected]>
Hi All,

Decided to ask this one of the list rather than #Moose.

Is there / should there be a *Moose::Meta::Role->rename_attribute* method?
It is easy to change the guts of an attribute using the *has "+"  *syntax,
but I have not found an official way to change the name of an attribute.   I
am wondering if Moose::Meta::Role should contain a rename_attribute method
that does something like the following:

        my ( $self, $old_name, $new_name ) = @_ ;

        my $attr = $self->meta->get_attribute( $old_name );
        $self->add_attribute( $new_name, $attr );
        $self->remove_attribute( $old_name );

Thoughts,

Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.