Home  |  Linux  | Mysql  | PHP  | XML
From:Paul Driver Date:Mon Sep 29 08:21:13 2008
Subject:Re: Moose::Meta::Role::rename_attribute
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. :)
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