From: Dave Rolsky Date: Sun, 26 Sep 2010 15:51:46 +0000 (-0500) Subject: Add inline_rebless_instance to metaclass X-Git-Tag: 1.09~33 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=75c4dcf327f0c824a890a909148af0b7a3faba2a;p=gitmo%2FClass-MOP.git Add inline_rebless_instance to metaclass --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index b3b6b97..628fee5 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -615,9 +615,14 @@ sub _create_meta_instance { sub inline_create_instance { my $self = shift; - my ($class) = @_; - return $self->get_meta_instance->inline_create_instance($class); + return $self->get_meta_instance->inline_create_instance(@_); +} + +sub inline_rebless_instance { + my $self = shift; + + return $self->get_meta_instance->inline_rebless_instance_structure(@_); } sub clone_object { @@ -1526,8 +1531,10 @@ construction of a new instance of the class. =item B<< $metaclass->inline_create_instance($class_var) >> -This method takes a variable name, and uses it create an inline snippet of -code that will create a new instance of the class. +=item B<< $metaclass->inline_rebless_instance($instance_var, $class_var) >> + +These methods takes variable names, and use them to create an inline snippet +of code that will create a new instance of the class. =back diff --git a/t/010_self_introspection.t b/t/010_self_introspection.t index fade182..f9d9a09 100644 --- a/t/010_self_introspection.t +++ b/t/010_self_introspection.t @@ -62,6 +62,7 @@ my @class_mop_class_methods = qw( instance_metaclass get_meta_instance inline_create_instance + inline_rebless_instance create_meta_instance _create_meta_instance new_object clone_object construct_instance _construct_instance