From: Shawn M Moore Date: Tue, 25 Nov 2008 06:23:20 +0000 (+0000) Subject: Use Moose's new create_anon_role API X-Git-Tag: 0.05~78 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=533553a00a33a6c2cc933226afb0f41f35afc8d7;p=gitmo%2FMooseX-Role-Parameterized.git Use Moose's new create_anon_role API --- diff --git a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm index 584382a..0b9b566 100644 --- a/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm +++ b/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm @@ -6,6 +6,8 @@ extends 'Moose::Meta::Role'; use MooseX::Role::Parameterized::Meta::Role::Parameterized; use MooseX::Role::Parameterized::Parameters; +use constant parameterized_role_metaclass => 'MooseX::Role::Parameterized::Meta::Role::Parameterized'; + has parameter_metaclass => ( is => 'rw', isa => 'Moose::Meta::Class', @@ -42,12 +44,7 @@ sub generate_role { my $parameters = $self->construct_parameters(%args); - my $metaclass = Moose::Meta::Class->create_anon_class( - superclasses => ['MooseX::Role::Parameterized::Meta::Role::Parameterized'], - ); - my $role = $metaclass->new_object( - parameters => $parameters, - ); + my $role = $self->parameterized_role_metaclass->create_anon_role(parameters => $parameters); local $MooseX::Role::Parameterized::CURRENT_METACLASS = $role; $self->role_generator->($parameters,