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
t/00-load.t
t/attribute.t
t/defaults.t
+t/immutable.t
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<init_meta> 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<MooseX::UndefTolerant::Attribute>.
+
=head1 AUTHOR
Cory G Watson, C<< <gphat at cpan.org> >>