From: Yuval Kogman Date: Sat, 16 Aug 2008 03:38:44 +0000 (+0000) Subject: metaclass option for Role::init_meta X-Git-Tag: 0_55_01~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ba3c3465b3322566532a2dd1f2b08f1658d8a58e;p=gitmo%2FMoose.git metaclass option for Role::init_meta --- diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index ab51709..cbf9f49 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -130,6 +130,8 @@ my $exporter = Moose::Exporter->setup_import_methods( return $METAS{$role} if exists $METAS{$role}; + my $metaclass = $args{metaclass} || "Moose::Meta::Role"; + # make a subtype for each Moose class role_type $role unless find_type_constraint($role); @@ -140,7 +142,7 @@ my $exporter = Moose::Exporter->setup_import_methods( || confess "You already have a &meta function, but it does not return a Moose::Meta::Role"; } else { - $meta = Moose::Meta::Role->initialize($role); + $meta = $metaclass->initialize($role); $meta->alias_method('meta' => sub { $meta }); }