[Moose-commits] r7331 - in
MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized:
. Meta/Role
sartak at code2.0beta.co.uk
sartak at code2.0beta.co.uk
Sun Jan 18 02:47:00 GMT 2009
Author: sartak
Date: 2009-01-17 18:47:00 -0800 (Sat, 17 Jan 2009)
New Revision: 7331
Modified:
MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Parameters.pm
Log:
Use attribute_metaclass in the constructor for parameters_metaclass, and
factor out more class names
Modified: MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
===================================================================
--- MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm 2009-01-18 02:46:31 UTC (rev 7330)
+++ MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm 2009-01-18 02:47:00 UTC (rev 7331)
@@ -3,17 +3,23 @@
extends 'Moose::Meta::Role';
use MooseX::Role::Parameterized::Meta::Role::Parameterized;
+use MooseX::Role::Parameterized::Meta::Parameter;
use MooseX::Role::Parameterized::Parameters;
use constant parameterized_role_metaclass => 'MooseX::Role::Parameterized::Meta::Role::Parameterized';
+use constant parameter_metaclass => 'MooseX::Role::Parameterized::Meta::Parameter';
+use constant parameters_class => 'MooseX::Role::Parameterized::Parameters';
has parameters_metaclass => (
is => 'rw',
isa => 'Moose::Meta::Class',
lazy => 1,
default => sub {
- Moose::Meta::Class->create_anon_class(
- superclasses => ['MooseX::Role::Parameterized::Parameters'],
+ my $self = shift;
+
+ $self->parameters_class->meta->create_anon_class(
+ superclasses => [$self->parameters_class],
+ attribute_metaclass => $self->parameter_metaclass,
);
},
);
Modified: MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Parameters.pm
===================================================================
--- MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Parameters.pm 2009-01-18 02:46:31 UTC (rev 7330)
+++ MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Parameters.pm 2009-01-18 02:47:00 UTC (rev 7331)
@@ -1,8 +1,4 @@
package MooseX::Role::Parameterized::Parameters;
-# XXX: Mister Wizard, what's the right way to declare a different attribute metaclass?
-use metaclass 'Moose::Meta::Class' => (
- attribute_metaclass => 'MooseX::Role::Parameterized::Meta::Parameter',
-);
use Moose;
__PACKAGE__->meta->make_immutable;
More information about the Moose-commits
mailing list