{
my %class_meta;
+ my %role_meta;
if ( $Moose::VERSION < 1.9900 ) {
require MooseX::StrictConstructor::Trait::Method::Constructor;
require MooseX::StrictConstructor::Trait::Class;
%class_meta
= ( class => ['MooseX::StrictConstructor::Trait::Class'] );
+ %role_meta
+ = (
+ role => ['MooseX::StrictConstructor::Trait::Role'],
+ application_to_class => ['MooseX::StrictConstructor::Trait::ApplicationToClass'],
+ application_to_role =>['MooseX::StrictConstructor::Trait::ApplicationToRole'],
+ );
}
Moose::Exporter->setup_import_methods(
class_metaroles => \%class_meta,
+ role_metaroles => \%role_meta,
base_class_roles => ['MooseX::StrictConstructor::Role::Object'],
);
}
does not declare, then it calls C<Moose->throw_error()>. This is a great way
to catch small typos.
+As of Moose 1.9900, this module can also be used in a role, in which case the
+constructor of the consuming class will become strict.
+
+
=head2 Subverting Strictness
You may find yourself wanting to have your constructor accept a