X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FAttribute.pm;h=cda2d538d9538da336c8cabac8ec4fb7a2dfa8a9;hb=d5d2fbb799207b6da4a57072e42fe3617d9f91b0;hp=ead19fc64928fa18e2d1ce797d85203bf66746eb;hpb=9b871d792c4f7ec085870ab705c0ea2b615ebe2d;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm index ead19fc..cda2d53 100644 --- a/lib/Class/MOP/Attribute.pm +++ b/lib/Class/MOP/Attribute.pm @@ -10,7 +10,7 @@ use Carp 'confess'; use Scalar::Util 'blessed', 'weaken'; use Try::Tiny; -our $VERSION = '0.97'; +our $VERSION = '1.07'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -73,7 +73,9 @@ sub _new { 'clearer' => $options->{clearer}, 'builder' => $options->{builder}, 'init_arg' => $options->{init_arg}, - 'default' => $options->{default}, + exists $options->{default} + ? ('default' => $options->{default}) + : (), 'initializer' => $options->{initializer}, 'definition_context' => $options->{definition_context}, # keep a weakened link to the @@ -117,7 +119,7 @@ sub initialize_instance_slot { $params->{$init_arg}, ); } - elsif (defined $self->{'default'}) { + elsif (exists $self->{'default'}) { $self->_set_initial_slot_value( $meta_instance, $instance, @@ -798,7 +800,7 @@ called when the instance is first being initialized. Returns the value without going through the accessor. Note that this works even with write-only accessors. -=item B<< $sttr->get_raw_value($instance) >> +=item B<< $attr->get_raw_value($instance) >> Returns the value without any side effects such as lazy attributes. @@ -914,7 +916,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006-2009 by Infinity Interactive, Inc. +Copyright 2006-2010 by Infinity Interactive, Inc. L