From: Stevan Little Date: Sat, 5 Apr 2008 15:48:32 +0000 (+0000) Subject: adding the MooseX::MetaDescription stuff distilled from Ernst X-Git-Tag: 0_64~78 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19fd173ff4cd3ce8184e1f01635dfef935c14a0f;p=gitmo%2FClass-MOP.git adding the MooseX::MetaDescription stuff distilled from Ernst --- diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm index 6042f5c..18b0426 100644 --- a/lib/Class/MOP/Attribute.pm +++ b/lib/Class/MOP/Attribute.pm @@ -253,7 +253,7 @@ sub associate_method { sub set_initial_value { my ($self, $instance, $value) = @_; $self->_set_initial_slot_value( - Class::MOP::Class->initialize(blessed($instance))->get_meta_instance, + $self->associated_class->get_meta_instance, $instance, $value ); @@ -262,33 +262,33 @@ sub set_initial_value { sub set_value { my ($self, $instance, $value) = @_; - Class::MOP::Class->initialize(blessed($instance)) - ->get_meta_instance - ->set_slot_value($instance, $self->name, $value); + $self->associated_class + ->get_meta_instance + ->set_slot_value($instance, $self->name, $value); } sub get_value { my ($self, $instance) = @_; - Class::MOP::Class->initialize(blessed($instance)) - ->get_meta_instance - ->get_slot_value($instance, $self->name); + $self->associated_class + ->get_meta_instance + ->get_slot_value($instance, $self->name); } sub has_value { my ($self, $instance) = @_; - Class::MOP::Class->initialize(blessed($instance)) - ->get_meta_instance - ->is_slot_initialized($instance, $self->name); + $self->associated_class + ->get_meta_instance + ->is_slot_initialized($instance, $self->name); } sub clear_value { my ($self, $instance) = @_; - Class::MOP::Class->initialize(blessed($instance)) - ->get_meta_instance - ->deinitialize_slot($instance, $self->name); + $self->associated_class + ->get_meta_instance + ->deinitialize_slot($instance, $self->name); } ## load em up ...