From: Chris Andrews Date: Sat, 9 Oct 2010 10:53:46 +0000 (+0100) Subject: Note that you can avoid having to add this module to every class. X-Git-Tag: 0.06~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d0abfb45e6748fe6594c2502206b30d2940a36aa;p=gitmo%2FMooseX-UndefTolerant.git Note that you can avoid having to add this module to every class. If you have your own Moose exporter class already, you can just add these roles there. --- diff --git a/lib/MooseX/UndefTolerant.pm b/lib/MooseX/UndefTolerant.pm index 3707141..92bd492 100644 --- a/lib/MooseX/UndefTolerant.pm +++ b/lib/MooseX/UndefTolerant.pm @@ -21,7 +21,7 @@ __END__ =head1 NAME -MooseX::UndefTolerant - Make your attribute(s) tolerant to undef intitialization +MooseX::UndefTolerant - Make your attribute(s) tolerant to undef initialization =head1 SYNOPSIS @@ -95,6 +95,20 @@ Or some type of codemulch using ternarys. This module allows you to make your attributes more tolerant of undef so that you can keep the first example: have your cake and eat it too! +=head1 USE IN YOUR MOOSE EXPORTER + +If you already have a custom Moose exporter class and you want this +behaviour everywhere, you can add these roles there with this call, in +your C routine: + + Moose::Util::MetaRole::apply_metaroles( + class_metaroles => { + attribute => [ 'MooseX::UndefTolerant::Attribute' ], + constructor => [ 'MooseX::UndefTolerant::Constructor' ], + }, + for => $args{for_class}, + ); + =head1 PER ATTRIBUTE =head1 AUTHOR