X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStrictConstructor%2FRole%2FMeta%2FMethod%2FConstructor.pm;h=43b2aa23bf396996436184755d4dcbf2bb5dd296;hb=df9653e61242b4328f2391e0c5eeb7a5033fe171;hp=9c869e8eb138b0cd2caf9902f5e5009ecdd51c6e;hpb=0639c294522cdd6d4de99e25eda6dd3290434b39;p=gitmo%2FMooseX-StrictConstructor.git diff --git a/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm b/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm index 9c869e8..43b2aa2 100644 --- a/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm +++ b/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm @@ -3,6 +3,7 @@ package MooseX::StrictConstructor::Role::Meta::Method::Constructor; use strict; use warnings; +use B (); use Carp (); use Moose::Role; @@ -15,7 +16,8 @@ around '_generate_BUILDALL' => sub { $source .= ";\n" if $source; my @attrs = ( - map {"$_ => 1,"} + '__INSTANCE__ => 1,', + map { B::perlstring($_) . ' => 1,' } grep {defined} map { $_->init_arg() } @{ $self->_attributes() } ); @@ -45,11 +47,13 @@ __END__ =head1 SYNOPSIS - Moose::Util::MetaRole::apply_metaclass_roles - ( for_class => $caller, - constructor_class_roles => - ['MooseX::StrictConstructor::Role::Meta::Method::Constructor'], - ); + Moose::Util::MetaRole::apply_metaroles( + for_class => $caller, + class => { + constructor => + ['MooseX::StrictConstructor::Role::Meta::Method::Constructor'], + }, + ); =head1 DESCRIPTION