Maybe something along the lines of:
around BUILDARGS => sub { my $orig = shift; my $self = shift; my $params = $self->$orig(@_); $params->{$_} || delete $params->{$_} for qw/ foo bar /; return $params; };
This will discard false parameters for the "foo" and "bar" attributes.
In reply to Re^6: Moose and default values
by tobyink
in thread Moose and default values
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |