clean undef-tolerant and undefined args in BUILDARGS
[gitmo/MooseX-UndefTolerant.git] / lib / MooseX / UndefTolerant.pm
index ccb6f33..294e8e4 100644 (file)
@@ -12,6 +12,7 @@ use MooseX::UndefTolerant::Constructor;
 
 
 my %metaroles = (
+    base_class_roles => [ 'MooseX::UndefTolerant::Object' ],
     class_metaroles => {
         attribute => [ 'MooseX::UndefTolerant::Attribute' ],
     }
@@ -88,7 +89,7 @@ Or, if you only want one attribute to have this behaviour:
 Loading this module in your L<Moose> class makes initialization of your
 attributes tolerant of undef.  If you specify the value of undef to any of
 the attributes they will not be initialized, effectively behaving as if you
-had not provided a value at all.
+had not provided a value at all.  Such values are also cleaned from BUILDARGS.
 
 You can also apply the 'UndefTolerant' trait to individual attributes. See
 L<MooseX::UndefTolerant::Attribute> for details.
@@ -140,11 +141,14 @@ See L<MooseX::UndefTolerant::Attribute>.
 =head1 CAVEATS
 
 This extension does not currently work in immutable classes when applying the
-trait to some (but not all) attributes in the class. This is because the
-inlined constructor initialization code currently lives in
+trait to a specific attributes in the class, as opposed to the class itself.
+This is because the inlined constructor initialization code currently lives in
 L<Moose::Meta::Class>, not L<Moose::Meta::Attribute>. The good news is that
 this is expected to be changing shortly.
 
+Also, BUILDARGS cannot be cleaned up if the entire class is not made undef
+tolerant, as attribute traits cannot modify class constructor behaviour.
+
 =head1 ACKNOWLEDGEMENTS
 
 Many thanks to the crew in #moose who talked me through this module: