a number of changes;
[gitmo/Class-MOP.git] / lib / Class / MOP.pm
index a401ee5..5f68dfd 100644 (file)
@@ -11,7 +11,7 @@ use Class::MOP::Class;
 use Class::MOP::Attribute;
 use Class::MOP::Method;
 
-our $VERSION = '0.01';
+our $VERSION = '0.06';
 
 sub import {
     shift;
@@ -48,18 +48,32 @@ sub import {
 ## Class::MOP::Class
 
 Class::MOP::Class->meta->add_attribute(
-    Class::MOP::Attribute->new('$:pkg' => (
-        init_arg => ':pkg'
+    Class::MOP::Attribute->new('$:package' => (
+        init_arg => ':package'
     ))
 );
 
 Class::MOP::Class->meta->add_attribute(
-    Class::MOP::Attribute->new('%:attrs' => (
-        init_arg => ':attrs',
+    Class::MOP::Attribute->new('%:attributes' => (
+        init_arg => ':attributes',
         default  => sub { {} }
     ))
 );
 
+Class::MOP::Class->meta->add_attribute(
+    Class::MOP::Attribute->new('$:attribute_metaclass' => (
+        init_arg => ':attribute_metaclass',
+        default  => 'Class::MOP::Attribute',
+    ))
+);
+
+Class::MOP::Class->meta->add_attribute(
+    Class::MOP::Attribute->new('$:method_metaclass' => (
+        init_arg => ':method_metaclass',
+        default  => 'Class::MOP::Method',        
+    ))
+);
+
 ## Class::MOP::Attribute
 
 Class::MOP::Attribute->meta->add_attribute(Class::MOP::Attribute->new('name'));
@@ -86,7 +100,7 @@ Class::MOP::Attribute->meta->add_method('new' => sub {
         || confess "You cannot declare an accessor and reader and/or writer functions"
             if exists $options{accessor};
             
-    bless $class->meta->construct_instance(name => $name, %options) => $class;
+    bless $class->meta->construct_instance(name => $name, %options) => blessed($class) || $class;
 });
 
 1;
@@ -154,7 +168,7 @@ of method dispatch.
 =head2 What changes do I have to make to use this module?
 
 This module was designed to be as unintrusive as possible. Many of 
-it's features are accessible without B<any> change to your existsing 
+its features are accessible without B<any> change to your existsing 
 code at all. It is meant to be a compliment to your existing code and 
 not an intrusion on your code base. Unlike many other B<Class::> 
 modules, this module B<does not> require you subclass it, or even that