use Moose;
extends 'Moose::Meta::Role';
+use MooseX::Role::Parameterized::Meta::Role::Parameterized;
use MooseX::Role::Parameterized::Parameters;
has parameter_metaclass => (
confess "A role generator is required to generate roles"
unless $self->has_role_generator;
+ my $parameters = $self->construct_parameters(%args);
+
my $metaclass = Moose::Meta::Class->create_anon_class(
- superclasses => ['Moose::Meta::Role'],
+ superclasses => ['MooseX::Role::Parameterized::Meta::Role::Parameterized'],
+ );
+ my $role = $metaclass->construct_instance(
+ parameters => $parameters,
);
- my $role = $metaclass->construct_instance;
-
- my $parameters = $self->construct_parameters(%args);
local $MooseX::Role::Parameterized::CURRENT_METACLASS = $role;
$self->role_generator->($parameters,
--- /dev/null
+#!/usr/bin/env perl
+package MooseX::Role::Parameterized::Meta::Role::Parameterized;
+use Moose;
+extends 'Moose::Meta::Role';
+
+has parameters => (
+ is => 'rw',
+ isa => 'MooseX::Role::Parameterized::Parameters',
+ required => 1,
+);
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+