From: Shawn M Moore Date: Wed, 15 Apr 2009 21:06:00 +0000 (-0400) Subject: Doc -metaclass in Moose, and -metaclass and -traits in Moose::Role X-Git-Tag: 0.75~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c138100057073893e58f4b9eec26a07939acb83e;p=gitmo%2FMoose.git Doc -metaclass in Moose, and -metaclass and -traits in Moose::Role --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 50ac497..d0c9050 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -807,10 +807,13 @@ C anywhere you need to test for an object's class name. =back -=head1 METACLASS TRAITS +=head1 METACLASS -When you use Moose, you can also specify traits which will be applied -to your metaclass: +When you use Moose, you can specify which metaclass to use: + + use Moose -metaclass => 'My::Meta::Class'; + +You can also specify traits which will be applied to your metaclass: use Moose -traits => 'My::Trait'; diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index e98b1b3..58bbd6c 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -241,6 +241,20 @@ the role so you can get at this object. The default metaclass is L. You can specify an alternate metaclass with the C parameter. +=head1 METACLASS + +When you use Moose::Role, you can specify which metaclass to use: + + use Moose::Role -metaclass => 'My::Meta::Role'; + +You can also specify traits which will be applied to your role metaclass: + + use Moose::Role -traits => 'My::Trait'; + +This is very similar to the attribute traits feature. When you do +this, your class's C object will have the specified traits +applied to it. See L for more details. + =head1 CAVEATS Role support has only a few caveats: