CMOP::Package should have an attribute for methods, just a private one
Dave Rolsky [Fri, 11 Sep 2009 15:22:13 +0000 (10:22 -0500)]
lib/Class/MOP.pm
t/010_self_introspection.t

index 1d97d40..bbe1b03 100644 (file)
@@ -207,6 +207,18 @@ Class::MOP::Package->meta->add_attribute(
 );
 
 Class::MOP::Package->meta->add_attribute(
+    Class::MOP::Attribute->new('_methods' => (
+        reader   => {
+            # NOTE:
+            # we just alias the original method
+            # rather than re-produce it here
+            '_full_method_map' => \&Class::MOP::Package::_full_method_map
+        },
+        default => sub { {} }
+    ))
+);
+
+Class::MOP::Package->meta->add_attribute(
     Class::MOP::Attribute->new('method_metaclass' => (
         reader   => {
             # NOTE:
index 1057261..2ebdbf7 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 300;
+use Test::More tests => 302;
 use Test::Exception;
 
 use Class::MOP;
@@ -164,6 +164,7 @@ my @class_mop_package_attributes = (
     'namespace',
     'method_metaclass',
     'wrapped_method_metaclass',
+    '_methods',
 );
 
 my @class_mop_module_attributes = (