use MooseX::HasDefaults::Meta::IsRO;
-Moose::Exporter->setup_import_methods(also => 'Moose');
-
-sub init_meta {
- shift;
- my %options = @_;
-
- Moose->init_meta(%options);
-
- Moose::Util::MetaRole::apply_metaclass_roles(
- for_class => $options{for_class},
- attribute_metaclass_roles => ['MooseX::HasDefaults::Meta::IsRO'],
- );
-
- return $options{for_class}->meta;
-}
+Moose::Exporter->setup_import_methods(
+ also => 'Moose',
+ class_metaroles => {
+ attribute => ['MooseX::HasDefaults::Meta::IsRO'],
+ },
+);
1;
use MooseX::HasDefaults::Meta::IsRW;
-Moose::Exporter->setup_import_methods(also => 'Moose');
-
-sub init_meta {
- shift;
- my %options = @_;
-
- Moose->init_meta(%options);
-
- Moose::Util::MetaRole::apply_metaclass_roles(
- for_class => $options{for_class},
- attribute_metaclass_roles => ['MooseX::HasDefaults::Meta::IsRW'],
- );
-
- return $options{for_class}->meta;
-}
+Moose::Exporter->setup_import_methods(
+ also => 'Moose',
+ class_metaroles => {
+ attribute => ['MooseX::HasDefaults::Meta::IsRW'],
+ },
+);
1;