Re: Moose::Meta::Role::rename_attribute

[email protected] (Paul Driver)
Newsgroups perl.moose
Message-ID <[email protected]>
On Sat, Sep 27, 2008 at 06:50:00PM +0100, Matt S Trout wrote:
> Instead, I think what you really want it one of
> 
> (1) export attribute declarators, so -
> 
> use MooseX::Attributes::File qw(has_file);
> 
> has_file 'infile';
> has_file 'outfile';
> 
> (2) an attribute metaclass that provides what you want as defaults
> 
> has 'infile' => (metaclass => 'File');
> has 'outfile' => (metaclass => 'File');

As to 2, I made a really dorky simple MooseX for doing this easily
a little while ago -- MooseX::AttributeDefaults.  Would love some
feedback on it if it's useful for you. :)
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.