From: Dave Rolsky Date: Mon, 16 Mar 2009 16:08:14 +0000 (-0500) Subject: make create_meta_instance private X-Git-Tag: 0.80_01~51 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=27e95ba535f08ed75978be7bec6729a7751d3a87;p=gitmo%2FClass-MOP.git make create_meta_instance private --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 743749b..db8b831 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -368,10 +368,16 @@ sub construct_instance { sub get_meta_instance { my $self = shift; - $self->{'_meta_instance'} ||= $self->create_meta_instance(); + $self->{'_meta_instance'} ||= $self->_create_meta_instance(); } sub create_meta_instance { + warn 'The create_meta_instance method has been made private.' + . " The public version is deprecated and will be removed in a future release.\n"; + goto &_create_meta_instance; +} + +sub _create_meta_instance { my $self = shift; my $instance = $self->instance_metaclass->new( diff --git a/t/010_self_introspection.t b/t/010_self_introspection.t index 19f1786..ef2412a 100644 --- a/t/010_self_introspection.t +++ b/t/010_self_introspection.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 248; +use Test::More tests => 250; use Test::Exception; use Class::MOP; @@ -55,7 +55,8 @@ my @class_mop_class_methods = qw( create_anon_class is_anon_class - instance_metaclass get_meta_instance create_meta_instance + instance_metaclass get_meta_instance + create_meta_instance _create_meta_instance new_object clone_object construct_instance construct_class_instance _construct_class_instance