X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-StrictConstructor.git;a=blobdiff_plain;f=lib%2FMooseX%2FStrictConstructor.pm;h=f14e4c452bfdff08877bf08356094874472f67cf;hp=b45c3f06f424ace1dd28a88df3ff070e88314023;hb=1a9d90ea66c704b902eda8d4c26d1262cc716abd;hpb=bb64c0458ed377f9a5a7f4d4071dee8cf0821312 diff --git a/lib/MooseX/StrictConstructor.pm b/lib/MooseX/StrictConstructor.pm index b45c3f0..f14e4c4 100644 --- a/lib/MooseX/StrictConstructor.pm +++ b/lib/MooseX/StrictConstructor.pm @@ -10,14 +10,16 @@ use Moose::Util::MetaRole; use MooseX::StrictConstructor::Trait::Class; use MooseX::StrictConstructor::Trait::Method::Constructor;; -Moose::Exporter->setup_import_methods( - class_metaroles => { - class => ['MooseX::StrictConstructor::Trait::Class'], - constructor => - ['MooseX::StrictConstructor::Trait::Method::Constructor'], - }, +my %metaroles = ( + class => ['MooseX::StrictConstructor::Trait::Class'], ); +$metaroles{constructor} + = ['MooseX::StrictConstructor::Trait::Method::Constructor'] + if $Moose::VERSION <= 1.9900; + +Moose::Exporter->setup_import_methods( class_metaroles => \%metaroles ); + 1; # ABSTRACT: Make your object constructors blow up on unknown attributes @@ -43,9 +45,9 @@ __END__ =head1 DESCRIPTION Simply loading this module makes your constructors "strict". If your -constructor is called with an attribute init argument that your class -does not declare, then it calls Cthrow_error()>. This is a great way -to catch small typos. +constructor is called with an attribute init argument that your class does not +declare, then it calls C<< Moose->throw_error() >>. This is a great way to +catch small typos. =head2 Subverting Strictness