in reply to Re^5: Moose and default values
in thread Moose and default values
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Moose and default values
by morgon (Priest) on Feb 20, 2013 at 23:02 UTC | |
by tobyink (Canon) on Feb 20, 2013 at 23:15 UTC | |
by morgon (Priest) on Feb 20, 2013 at 23:28 UTC | |
by tobyink (Canon) on Feb 20, 2013 at 23:54 UTC |