bump version to 0.92_01 and add release date
[gitmo/Class-MOP.git] / lib / Class / MOP / Class.pm
index a1de0c8..2cb803c 100644 (file)
@@ -14,7 +14,7 @@ use Scalar::Util 'blessed', 'reftype', 'weaken';
 use Sub::Name    'subname';
 use Devel::GlobalDestruction 'in_global_destruction';
 
-our $VERSION   = '0.90';
+our $VERSION   = '0.92_01';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -41,12 +41,6 @@ sub initialize {
         || $class->_construct_class_instance(package => $package_name, @_);
 }
 
-sub construct_class_instance {
-    Carp::cluck('The construct_class_instance method has been made private.'
-        . " The public version is deprecated and will be removed in a future release.\n");
-    shift->_construct_class_instance(@_);
-}
-
 # NOTE: (meta-circularity)
 # this is a special form of _construct_instance
 # (see below), which is used to construct class
@@ -75,7 +69,7 @@ sub _construct_class_instance {
     # get the name of the class appropriately
     $class = (ref($class)
                     ? ($class->is_immutable
-                        ? $class->get_mutable_metaclass_name()
+                        ? $class->_get_mutable_metaclass_name()
                         : ref($class))
                     : $class);
 
@@ -170,13 +164,6 @@ sub update_package_cache_flag {
     $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name);    
 }
 
-
-sub check_metaclass_compatibility {
-    Carp::cluck('The check_metaclass_compatibility method has been made private.'
-        . " The public version is deprecated and will be removed in a future release.\n");
-    shift->_check_metaclass_compatibility(@_);
-}
-
 sub _check_metaclass_compatibility {
     my $self = shift;
 
@@ -196,7 +183,7 @@ sub _check_metaclass_compatibility {
         # get the name of the class appropriately
         my $super_meta_type
             = $super_meta->is_immutable
-            ? $super_meta->get_mutable_metaclass_name()
+            ? $super_meta->_get_mutable_metaclass_name()
             : ref($super_meta);
 
         ($self->isa($super_meta_type))
@@ -364,12 +351,6 @@ sub new_object {
     return $class->_construct_instance(@_);
 }
 
-sub construct_instance {
-    Carp::cluck('The construct_instance method has been made private.'
-        . " The public version is deprecated and will be removed in a future release.\n");
-    shift->_construct_instance(@_);
-}
-
 sub _construct_instance {
     my $class = shift;
     my $params = @_ == 1 ? $_[0] : {@_};
@@ -403,12 +384,6 @@ sub get_meta_instance {
     $self->{'_meta_instance'} ||= $self->_create_meta_instance();
 }
 
-sub create_meta_instance {
-    Carp::cluck('The create_meta_instance method has been made private.'
-        . " The public version is deprecated and will be removed in a future release.\n");
-    shift->_create_meta_instance(@_);
-}
-
 sub _create_meta_instance {
     my $self = shift;
     
@@ -437,12 +412,6 @@ sub clone_object {
     $class->_clone_instance($instance, @_);
 }
 
-sub clone_instance {
-    Carp::cluck('The clone_instance method has been made private.'
-        . " The public version is deprecated and will be removed in a future release.\n");
-    shift->_clone_instance(@_);
-}
-
 sub _clone_instance {
     my ($class, $instance, %params) = @_;
     (blessed($instance))
@@ -668,12 +637,6 @@ sub class_precedence_list {
     # to, and so don't need the fully qualified name.
 }
 
-sub alias_method {
-    Carp::cluck("The alias_method method is deprecated. Use add_method instead.\n");
-
-    shift->add_method(@_);
-}
-
 sub find_method_by_name {
     my ($self, $method_name) = @_;
     (defined $method_name && $method_name)
@@ -691,19 +654,6 @@ sub get_all_methods {
     return values %methods;
 }
 
-sub compute_all_applicable_methods {
-    Carp::cluck('The compute_all_applicable_methods method is deprecated.'
-        . " Use get_all_methods instead.\n");
-
-    return map {
-        {
-            name  => $_->name,
-            class => $_->package_name,
-            code  => $_, # sigh, overloading
-        },
-    } shift->get_all_methods(@_);
-}
-
 sub get_all_method_names {
     my $self = shift;
     my %uniq;
@@ -854,14 +804,14 @@ sub invalidate_meta_instance {
 
 sub has_attribute {
     my ($self, $attribute_name) = @_;
-    (defined $attribute_name && $attribute_name)
+    (defined $attribute_name)
         || confess "You must define an attribute name";
     exists $self->get_attribute_map->{$attribute_name};
 }
 
 sub get_attribute {
     my ($self, $attribute_name) = @_;
-    (defined $attribute_name && $attribute_name)
+    (defined $attribute_name)
         || confess "You must define an attribute name";
     return $self->get_attribute_map->{$attribute_name}
     # NOTE:
@@ -872,7 +822,7 @@ sub get_attribute {
 
 sub remove_attribute {
     my ($self, $attribute_name) = @_;
-    (defined $attribute_name && $attribute_name)
+    (defined $attribute_name)
         || confess "You must define an attribute name";
     my $removed_attribute = $self->get_attribute_map->{$attribute_name};
     return unless defined $removed_attribute;
@@ -894,13 +844,6 @@ sub get_all_attributes {
     return values %attrs;
 }
 
-sub compute_all_applicable_attributes {
-    Carp::cluck('The compute_all_applicable_attributes method has been deprecated.'
-        . " Use get_all_attributes instead.\n");
-
-    shift->get_all_attributes(@_);
-}
-
 sub find_attribute_by_name {
     my ($self, $attr_name) = @_;
     foreach my $class ($self->linearized_isa) {
@@ -936,6 +879,8 @@ sub is_pristine {
 sub is_mutable   { 1 }
 sub is_immutable { 0 }
 
+sub immutable_options { %{ $_[0]{__immutable}{options} || {} } }
+
 sub _immutable_options {
     my ( $self, @args ) = @_;
 
@@ -1022,7 +967,7 @@ sub _immutable_metaclass {
     # example of where this matters).
     my $meta_name
         = $meta->is_immutable
-        ? $meta->get_mutable_metaclass_name
+        ? $meta->_get_mutable_metaclass_name
         : ref $meta;
 
     my $immutable_meta = $meta_name->create(
@@ -1085,7 +1030,7 @@ sub _install_inlined_code {
 sub _rebless_as_mutable {
     my $self = shift;
 
-    bless $self, $self->get_mutable_metaclass_name;
+    bless $self, $self->_get_mutable_metaclass_name;
 
     return $self;
 }
@@ -1551,7 +1496,7 @@ object instances created for this class, not existing instances.
 =item B<< $metaclass->attribute_metaclass >>
 
 Returns the class name of the attribute metaclass for this class. By
-default, this is L<Class::MOP::Attribute>.  for more information on
+default, this is L<Class::MOP::Attribute>.
 
 =back
 
@@ -1634,6 +1579,13 @@ replaced when inlining a destructor. This defaults to false.
 
 =back
 
+=item B<< $metaclass->immutable_options >>
+
+Returns a hash of the options used when making the class immutable, including
+both defaults and anything supplied by the user in the call to C<<
+$metaclass->make_immutable >>. This is useful if you need to temporarily make
+a class mutable and then restore immutability as it was before.
+
 =item B<< $metaclass->make_mutable >>
 
 Calling this method reverse the immutabilization transformation.