))
);
-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
- 'get_method_map' => \&Class::MOP::Package::get_method_map
- },
- default => sub { {} }
- ))
-);
-
-Class::MOP::Package->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::Package::method_metaclass
- },
- default => 'Class::MOP::Method',
- ))
-);
-
-Class::MOP::Package->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::Package::wrapped_method_metaclass
- },
- default => 'Class::MOP::Method::Wrapped',
- ))
-);
-
## --------------------------------------------------------
## Class::MOP::Module
))
);
+Class::MOP::Module->meta->add_attribute(
+ Class::MOP::Attribute->new('methods' => (
+ reader => {
+ # NOTE:
+ # we just alias the original method
+ # rather than re-produce it here
+ 'get_method_map' => \&Class::MOP::Module::get_method_map
+ },
+ default => sub { {} }
+ ))
+);
+
+Class::MOP::Module->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::Module::method_metaclass
+ },
+ default => 'Class::MOP::Method',
+ ))
+);
+
+Class::MOP::Module->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::Module::wrapped_method_metaclass
+ },
+ default => 'Class::MOP::Method::Wrapped',
+ ))
+);
+
## --------------------------------------------------------
## Class::MOP::Class
my @class_mop_package_attributes = (
'package',
'namespace',
- 'methods',
- 'method_metaclass',
- 'wrapped_method_metaclass',
);
my @class_mop_module_attributes = (
'version',
- 'authority'
+ 'authority',
+
+ 'methods',
+ 'method_metaclass',
+ 'wrapped_method_metaclass',
);
my @class_mop_class_attributes = (
ok($class_mop_package_meta->get_attribute('package')->has_init_arg, '... Class::MOP::Class package has a init_arg');
is($class_mop_package_meta->get_attribute('package')->init_arg, 'package', '... Class::MOP::Class package\'s a init_arg is package');
-ok($class_mop_package_meta->get_attribute('method_metaclass')->has_reader, '... Class::MOP::Package method_metaclass has a reader');
-is_deeply($class_mop_package_meta->get_attribute('method_metaclass')->reader,
- { 'method_metaclass' => \&Class::MOP::Package::method_metaclass },
- '... Class::MOP::Package method_metaclass\'s a reader is &method_metaclass');
+# ... module
+
+ok($class_mop_module_meta->get_attribute('method_metaclass')->has_reader, '... Class::MOP::Module method_metaclass has a reader');
+is_deeply($class_mop_module_meta->get_attribute('method_metaclass')->reader,
+ { 'method_metaclass' => \&Class::MOP::Module::method_metaclass },
+ '... Class::MOP::Module method_metaclass\'s a reader is &method_metaclass');
-ok($class_mop_package_meta->get_attribute('method_metaclass')->has_init_arg, '... Class::MOP::Package method_metaclass has a init_arg');
-is($class_mop_package_meta->get_attribute('method_metaclass')->init_arg,
+ok($class_mop_module_meta->get_attribute('method_metaclass')->has_init_arg, '... Class::MOP::Module method_metaclass has a init_arg');
+is($class_mop_module_meta->get_attribute('method_metaclass')->init_arg,
'method_metaclass',
- '... Class::MOP::Package method_metaclass\'s init_arg is method_metaclass');
+ '... Class::MOP::Module method_metaclass\'s init_arg is method_metaclass');
-ok($class_mop_package_meta->get_attribute('method_metaclass')->has_default, '... Class::MOP::Package method_metaclass has a default');
-is($class_mop_package_meta->get_attribute('method_metaclass')->default,
+ok($class_mop_module_meta->get_attribute('method_metaclass')->has_default, '... Class::MOP::Module method_metaclass has a default');
+is($class_mop_module_meta->get_attribute('method_metaclass')->default,
'Class::MOP::Method',
- '... Class::MOP::Package method_metaclass\'s a default is Class::MOP:::Method');
+ '... Class::MOP::Module method_metaclass\'s a default is Class::MOP:::Method');
-ok($class_mop_package_meta->get_attribute('wrapped_method_metaclass')->has_reader, '... Class::MOP::Package wrapped_method_metaclass has a reader');
-is_deeply($class_mop_package_meta->get_attribute('wrapped_method_metaclass')->reader,
- { 'wrapped_method_metaclass' => \&Class::MOP::Package::wrapped_method_metaclass },
- '... Class::MOP::Package wrapped_method_metaclass\'s a reader is &wrapped_method_metaclass');
+ok($class_mop_module_meta->get_attribute('wrapped_method_metaclass')->has_reader, '... Class::MOP::Module wrapped_method_metaclass has a reader');
+is_deeply($class_mop_module_meta->get_attribute('wrapped_method_metaclass')->reader,
+ { 'wrapped_method_metaclass' => \&Class::MOP::Module::wrapped_method_metaclass },
+ '... Class::MOP::Module wrapped_method_metaclass\'s a reader is &wrapped_method_metaclass');
-ok($class_mop_package_meta->get_attribute('wrapped_method_metaclass')->has_init_arg, '... Class::MOP::Package wrapped_method_metaclass has a init_arg');
-is($class_mop_package_meta->get_attribute('wrapped_method_metaclass')->init_arg,
+ok($class_mop_module_meta->get_attribute('wrapped_method_metaclass')->has_init_arg, '... Class::MOP::Module wrapped_method_metaclass has a init_arg');
+is($class_mop_module_meta->get_attribute('wrapped_method_metaclass')->init_arg,
'wrapped_method_metaclass',
- '... Class::MOP::Package wrapped_method_metaclass\'s init_arg is wrapped_method_metaclass');
+ '... Class::MOP::Module wrapped_method_metaclass\'s init_arg is wrapped_method_metaclass');
-ok($class_mop_package_meta->get_attribute('method_metaclass')->has_default, '... Class::MOP::Package method_metaclass has a default');
-is($class_mop_package_meta->get_attribute('method_metaclass')->default,
+ok($class_mop_module_meta->get_attribute('method_metaclass')->has_default, '... Class::MOP::Module method_metaclass has a default');
+is($class_mop_module_meta->get_attribute('method_metaclass')->default,
'Class::MOP::Method',
- '... Class::MOP::Package method_metaclass\'s a default is Class::MOP:::Method');
+ '... Class::MOP::Module method_metaclass\'s a default is Class::MOP:::Method');
# ... class