bump version to 0.89
[gitmo/Class-MOP.git] / lib / Class / MOP / Instance.pm
index 16dd6e0..8643e3e 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 
 use Scalar::Util 'weaken', 'blessed';
 
-our $VERSION   = '0.78';
+our $VERSION   = '0.89';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -75,6 +75,9 @@ sub create_instance {
 
 # for compatibility
 sub bless_instance_structure {
+    Carp::cluck('The bless_instance_structure method is deprecated.'
+        . " It will be removed in a future release.\n");
+
     my ($self, $instance_structure) = @_;
     bless $instance_structure, $self->_class_name;
 }
@@ -174,7 +177,7 @@ sub inline_create_instance {
 
 sub inline_slot_access {
     my ($self, $instance, $slot_name) = @_;
-    sprintf q[%s->{"%s"}], $instance, quotemeta($slot_name);
+    sprintf q[%s->{'%s'}], $instance, quotemeta($slot_name);
 }
 
 sub inline_get_slot_value {
@@ -211,6 +214,11 @@ sub inline_strengthen_slot_value {
     $self->inline_set_slot_value($instance, $slot_name, $self->inline_slot_access($instance, $slot_name));
 }
 
+sub inline_rebless_instance_structure {
+    my ($self, $instance, $class_variable) = @_;
+    "bless $instance => $class_variable";
+}
+
 1;
 
 __END__
@@ -223,7 +231,7 @@ Class::MOP::Instance - Instance Meta Object
 
 =head1 DESCRIPTION
 
-The meta instance API controls the creation of object instances, and
+The Instance Protocol controls the creation of object instances, and
 the storage of attribute values in those instances.
 
 Using this API directly in your own code violates encapsulation, and
@@ -382,6 +390,12 @@ The second argument is a slot name.
 The method returns a snippet of code that, when inlined, performs some
 operation on the instance.
 
+=item B<< $metainstance->inline_rebless_instance_structure($instance_variable, $class_variable) >>
+
+This takes the name of a variable that will, when inlined, represent the object
+instance, and the name of a variable that will represent the class to rebless
+into, and returns code to rebless an instance into a class.
+
 =back
 
 =head2 Introspection