LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Christopher Brown Date: Wed Sep 24 18:50:00 2008 Subject: Moose::Meta::Role::rename_attribute
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
| Navigate in group perl.moose at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |