use Class::MOP::Attribute;
use Class::MOP::Method;
-our $VERSION = '0.03';
+our $VERSION = '0.06';
sub import {
shift;
## 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'));
|| 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;
=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