First commit.
[gitmo/MooseX-UndefTolerant.git] / lib / MooseX / UndefTolerant / Attribute.pm
1 package MooseX::UndefTolerant::Attribute;
2 use Moose::Role;
3
4 around('initialize_instance_slot', sub{
5     my $orig = shift;
6     my $self = shift;
7
8     # If the parameter passed in was undef, quietly do nothing but return
9     return unless defined($_->[2]);
10
11     # If it was defined, call the real init slot method
12     $self->$orig(@_)
13 });
14
15 1;