From: Cory Watson Date: Mon, 11 Oct 2010 12:19:11 +0000 (-0500) Subject: Update MANIFEST and fix up some docs. X-Git-Tag: 0.06~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-UndefTolerant.git;a=commitdiff_plain;h=1cbb963bab4cec7c79c8fdaa6c71aa67cdc1abae Update MANIFEST and fix up some docs. --- diff --git a/MANIFEST b/MANIFEST index c712eda..1a67c27 100644 --- a/MANIFEST +++ b/MANIFEST @@ -10,6 +10,7 @@ inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/MooseX/UndefTolerant.pm lib/MooseX/UndefTolerant/Attribute.pm +lib/MooseX/UndefTolerant/Constructor.pm Makefile.PL MANIFEST This list of files META.yml @@ -17,3 +18,4 @@ README t/00-load.t t/attribute.t t/defaults.t +t/immutable.t diff --git a/lib/MooseX/UndefTolerant.pm b/lib/MooseX/UndefTolerant.pm index 92bd492..f7312bb 100644 --- a/lib/MooseX/UndefTolerant.pm +++ b/lib/MooseX/UndefTolerant.pm @@ -86,31 +86,19 @@ Maybe[Str] and I still want my predicate (C) to work. The only real solution was: if(defined($foo)) { - $class = My:CLass->new(foo => $foo, bar => 123); + $class = My:Class->new(foo => $foo, bar => 123); } else { - $class = My:CLass->new(bar => 123); + $class = My:Class->new(bar => 123); } 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 +See L. + =head1 AUTHOR Cory G Watson, C<< >>