use Scalar::Util 'weaken', 'reftype', 'blessed';
use Try::Tiny;
-use Class::MOP::HasAttributes;
-use Class::MOP::HasMethods;
+use Class::MOP::Mixin::HasAttributes;
+use Class::MOP::Mixin::HasMethods;
use Class::MOP::Class;
use Class::MOP::Attribute;
use Class::MOP::Method;
# inherit them using _construct_instance
## --------------------------------------------------------
-## Class::MOP::HasMethods
+## Class::MOP::Mixin::HasMethods
-Class::MOP::HasMethods->meta->add_attribute(
+Class::MOP::Mixin::HasMethods->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::HasMethods::_full_method_map
+ '_full_method_map' => \&Class::MOP::Mixin::HasMethods::_full_method_map
},
default => sub { {} }
))
);
-Class::MOP::HasMethods->meta->add_attribute(
+Class::MOP::Mixin::HasMethods->meta->add_attribute(
Class::MOP::Attribute->new('method_metaclass' => (
reader => {
# NOTE:
# we just alias the original method
# rather than re-produce it here
- 'method_metaclass' => \&Class::MOP::HasMethods::method_metaclass
+ 'method_metaclass' => \&Class::MOP::Mixin::HasMethods::method_metaclass
},
default => 'Class::MOP::Method',
))
);
-Class::MOP::HasMethods->meta->add_attribute(
+Class::MOP::Mixin::HasMethods->meta->add_attribute(
Class::MOP::Attribute->new('wrapped_method_metaclass' => (
reader => {
# NOTE:
# we just alias the original method
# rather than re-produce it here
- 'wrapped_method_metaclass' => \&Class::MOP::HasMethods::wrapped_method_metaclass
+ 'wrapped_method_metaclass' => \&Class::MOP::Mixin::HasMethods::wrapped_method_metaclass
},
default => 'Class::MOP::Method::Wrapped',
))
);
## --------------------------------------------------------
-## Class::MOP::HasMethods
+## Class::MOP::Mixin::HasMethods
-Class::MOP::HasAttributes->meta->add_attribute(
+Class::MOP::Mixin::HasAttributes->meta->add_attribute(
Class::MOP::Attribute->new('attributes' => (
reader => {
# NOTE: we need to do this in order
#
# we just alias the original method
# rather than re-produce it here
- '_attribute_map' => \&Class::MOP::HasAttributes::_attribute_map
+ '_attribute_map' => \&Class::MOP::Mixin::HasAttributes::_attribute_map
},
default => sub { {} }
))
);
-Class::MOP::HasAttributes->meta->add_attribute(
+Class::MOP::Mixin::HasAttributes->meta->add_attribute(
Class::MOP::Attribute->new('attribute_metaclass' => (
reader => {
# NOTE:
# we just alias the original method
# rather than re-produce it here
- 'attribute_metaclass' => \&Class::MOP::HasAttributes::attribute_metaclass
+ 'attribute_metaclass' => \&Class::MOP::Mixin::HasAttributes::attribute_metaclass
},
default => 'Class::MOP::Attribute',
))
constructor_name => undef,
inline_accessors => 0,
) for qw/
- Class::MOP::HasAttributes
- Class::MOP::HasMethods
+ Class::MOP::Mixin::HasAttributes
+ Class::MOP::Mixin::HasMethods
/;
1;
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-use base 'Class::MOP::Module', 'Class::MOP::HasAttributes';
+use base 'Class::MOP::Module', 'Class::MOP::Mixin::HasAttributes';
# Creation
-package Class::MOP::HasAttributes;
+package Class::MOP::Mixin::HasAttributes;
use strict;
use warnings;
-package Class::MOP::HasMethods;
+package Class::MOP::Mixin::HasMethods;
use strict;
use warnings;
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-use base 'Class::MOP::HasMethods';
+use base 'Class::MOP::Mixin::HasMethods';
# creation ...
BEGIN {
use_ok('Class::MOP');
- use_ok('Class::MOP::HasAttributes');
- use_ok('Class::MOP::HasMethods');
+ use_ok('Class::MOP::Mixin::HasAttributes');
+ use_ok('Class::MOP::Mixin::HasMethods');
use_ok('Class::MOP::Package');
use_ok('Class::MOP::Module');
use_ok('Class::MOP::Class');
'Class::MOP::Method::Accessor' => Class::MOP::Method::Accessor->meta,
'Class::MOP::Method::Constructor' =>
Class::MOP::Method::Constructor->meta,
- 'Class::MOP::HasAttributes' => Class::MOP::HasAttributes->meta,
- 'Class::MOP::HasMethods' => Class::MOP::HasMethods->meta,
+ 'Class::MOP::Mixin::HasAttributes' => Class::MOP::Mixin::HasAttributes->meta,
+ 'Class::MOP::Mixin::HasMethods' => Class::MOP::Mixin::HasMethods->meta,
'Class::MOP::Package' => Class::MOP::Package->meta,
'Class::MOP::Module' => Class::MOP::Module->meta,
'Class::MOP::Class' => Class::MOP::Class->meta,
Class::MOP::Class->meta,
Class::MOP::Class::Immutable::Class::MOP::Class->meta,
Class::MOP::class_of('Class::MOP::Class::Immutable::Trait'),
- Class::MOP::HasAttributes->meta,
- Class::MOP::HasMethods->meta,
Class::MOP::Instance->meta,
Class::MOP::Method->meta,
Class::MOP::Method::Accessor->meta,
Class::MOP::Method::Generated->meta,
Class::MOP::Method::Inlined->meta,
Class::MOP::Method::Wrapped->meta,
+ Class::MOP::Mixin::HasAttributes->meta,
+ Class::MOP::Mixin::HasMethods->meta,
Class::MOP::Module->meta,
Class::MOP::Object->meta,
Class::MOP::Package->meta,
Class::MOP::Class
Class::MOP::Class::Immutable::Class::MOP::Class
Class::MOP::Class::Immutable::Trait
- Class::MOP::HasAttributes
- Class::MOP::HasMethods
+ Class::MOP::Mixin::HasAttributes
+ Class::MOP::Mixin::HasMethods
Class::MOP::Instance
Class::MOP::Method
Class::MOP::Method::Accessor
# ... package, but inherited from HasMethods
ok($class_mop_package_meta->find_attribute_by_name('method_metaclass')->has_reader, '... Class::MOP::Package method_metaclass has a reader');
is_deeply($class_mop_package_meta->find_attribute_by_name('method_metaclass')->reader,
- { 'method_metaclass' => \&Class::MOP::HasMethods::method_metaclass },
+ { 'method_metaclass' => \&Class::MOP::Mixin::HasMethods::method_metaclass },
'... Class::MOP::Package method_metaclass\'s a reader is &method_metaclass');
ok($class_mop_package_meta->find_attribute_by_name('method_metaclass')->has_init_arg, '... Class::MOP::Package method_metaclass has a init_arg');
ok($class_mop_package_meta->find_attribute_by_name('wrapped_method_metaclass')->has_reader, '... Class::MOP::Package wrapped_method_metaclass has a reader');
is_deeply($class_mop_package_meta->find_attribute_by_name('wrapped_method_metaclass')->reader,
- { 'wrapped_method_metaclass' => \&Class::MOP::HasMethods::wrapped_method_metaclass },
+ { 'wrapped_method_metaclass' => \&Class::MOP::Mixin::HasMethods::wrapped_method_metaclass },
'... Class::MOP::Package wrapped_method_metaclass\'s a reader is &wrapped_method_metaclass');
ok($class_mop_package_meta->find_attribute_by_name('wrapped_method_metaclass')->has_init_arg, '... Class::MOP::Package wrapped_method_metaclass has a init_arg');
ok($class_mop_class_meta->find_attribute_by_name('attributes')->has_reader, '... Class::MOP::Class attributes has a reader');
is_deeply($class_mop_class_meta->find_attribute_by_name('attributes')->reader,
- { '_attribute_map' => \&Class::MOP::HasAttributes::_attribute_map },
+ { '_attribute_map' => \&Class::MOP::Mixin::HasAttributes::_attribute_map },
'... Class::MOP::Class attributes\'s a reader is &_attribute_map');
ok($class_mop_class_meta->find_attribute_by_name('attributes')->has_init_arg, '... Class::MOP::Class attributes has a init_arg');
ok($class_mop_class_meta->find_attribute_by_name('attribute_metaclass')->has_reader, '... Class::MOP::Class attribute_metaclass has a reader');
is_deeply($class_mop_class_meta->find_attribute_by_name('attribute_metaclass')->reader,
- { 'attribute_metaclass' => \&Class::MOP::HasAttributes::attribute_metaclass },
+ { 'attribute_metaclass' => \&Class::MOP::Mixin::HasAttributes::attribute_metaclass },
'... Class::MOP::Class attribute_metaclass\'s a reader is &attribute_metaclass');
ok($class_mop_class_meta->find_attribute_by_name('attribute_metaclass')->has_init_arg, '... Class::MOP::Class attribute_metaclass has a init_arg');
is_deeply(
[ $class_mop_class_meta->superclasses ],
- [ qw/Class::MOP::Module Class::MOP::HasAttributes/ ],
+ [ qw/Class::MOP::Module Class::MOP::Mixin::HasAttributes/ ],
'... Class::MOP::Class->superclasses == [ Class::MOP::Module ]');
is_deeply(
Class::MOP::Class
Class::MOP::Module
Class::MOP::Package
- Class::MOP::HasMethods
+ Class::MOP::Mixin::HasMethods
Class::MOP::Object
- Class::MOP::HasAttributes
+ Class::MOP::Mixin::HasAttributes
Class::MOP::Object
/ ],
'... Class::MOP::Class->class_precedence_list == [ Class::MOP::Class Class::MOP::Module Class::MOP::Package ]');
}
}
-MODULE = Class::MOP::HasMethods PACKAGE = Class::MOP::HasMethods
+MODULE = Class::MOP::Mixin::HasMethods PACKAGE = Class::MOP::Mixin::HasMethods
PROTOTYPES: DISABLE
return FALSE;
}
-EXTERN_C XS(boot_Class__MOP__HasMethods);
+EXTERN_C XS(boot_Class__MOP__Mixin__HasMethods);
EXTERN_C XS(boot_Class__MOP__Package);
EXTERN_C XS(boot_Class__MOP__Attribute);
EXTERN_C XS(boot_Class__MOP__Method);
BOOT:
mop_prehash_keys();
- MOP_CALL_BOOT (boot_Class__MOP__HasMethods);
+ MOP_CALL_BOOT (boot_Class__MOP__Mixin__HasMethods);
MOP_CALL_BOOT (boot_Class__MOP__Package);
MOP_CALL_BOOT (boot_Class__MOP__Attribute);
MOP_CALL_BOOT (boot_Class__MOP__Method);