2 package Moose::Meta::Role;
8 use Class::Load qw(load_class);
9 use Scalar::Util 'blessed';
11 use Devel::GlobalDestruction 'in_global_destruction';
13 use Moose::Meta::Class;
14 use Moose::Meta::Role::Attribute;
15 use Moose::Meta::Role::Method;
16 use Moose::Meta::Role::Method::Required;
17 use Moose::Meta::Role::Method::Conflicting;
18 use Moose::Meta::Method::Meta;
19 use Moose::Util qw( ensure_all_roles );
21 use base 'Class::MOP::Module',
22 'Class::MOP::Mixin::HasAttributes',
23 'Class::MOP::Mixin::HasMethods';
25 ## ------------------------------------------------------------------
27 ## I normally don't do this, but I am doing
28 ## a whole bunch of meta-programmin in this
29 ## module, so it just makes sense. For a clearer
30 ## picture of what is going on in the next
31 ## several lines of code, look at the really
32 ## big comment at the end of this file (right
35 ## ------------------------------------------------------------------
37 my $META = __PACKAGE__->meta;
39 ## ------------------------------------------------------------------
43 # since roles are lazy, we hold all the attributes
44 # of the individual role in 'statis' until which
45 # time when it is applied to a class. This means
46 # keeping a lot of things in hash maps, so we are
47 # using a little of that meta-programmin' magic
48 # here an saving lots of extra typin. And since
49 # many of these attributes above require similar
50 # functionality to support them, so we again use
51 # the wonders of meta-programmin' to deliver a
52 # very compact solution to this normally verbose
58 name => 'excluded_roles_map',
59 attr_reader => 'get_excluded_roles_map' ,
61 add => 'add_excluded_roles',
62 get_keys => 'get_excluded_roles_list',
63 existence => 'excludes_role',
67 name => 'required_methods',
68 attr_reader => 'get_required_methods_map',
70 remove => 'remove_required_methods',
71 get_values => 'get_required_method_list',
72 existence => 'requires_method',
77 my $attr_reader = $action->{attr_reader};
78 my $methods = $action->{methods};
80 # create the attribute
81 $META->add_attribute($action->{name} => (
82 reader => $attr_reader,
83 default => sub { {} },
84 Class::MOP::_definition_context(),
87 # create some helper methods
88 $META->add_method($methods->{add} => sub {
89 my ($self, @values) = @_;
90 $self->$attr_reader->{$_} = undef foreach @values;
91 }) if exists $methods->{add};
93 $META->add_method($methods->{get_keys} => sub {
95 keys %{$self->$attr_reader};
96 }) if exists $methods->{get_keys};
98 $META->add_method($methods->{get_values} => sub {
100 values %{$self->$attr_reader};
101 }) if exists $methods->{get_values};
103 $META->add_method($methods->{get} => sub {
104 my ($self, $name) = @_;
105 $self->$attr_reader->{$name}
106 }) if exists $methods->{get};
108 $META->add_method($methods->{existence} => sub {
109 my ($self, $name) = @_;
110 exists $self->$attr_reader->{$name} ? 1 : 0;
111 }) if exists $methods->{existence};
113 $META->add_method($methods->{remove} => sub {
114 my ($self, @values) = @_;
115 delete $self->$attr_reader->{$_} foreach @values;
116 }) if exists $methods->{remove};
119 $META->add_attribute(
121 reader => 'method_metaclass',
122 default => 'Moose::Meta::Role::Method',
123 Class::MOP::_definition_context(),
126 $META->add_attribute(
127 'required_method_metaclass',
128 reader => 'required_method_metaclass',
129 default => 'Moose::Meta::Role::Method::Required',
130 Class::MOP::_definition_context(),
133 $META->add_attribute(
134 'conflicting_method_metaclass',
135 reader => 'conflicting_method_metaclass',
136 default => 'Moose::Meta::Role::Method::Conflicting',
137 Class::MOP::_definition_context(),
140 $META->add_attribute(
141 'application_to_class_class',
142 reader => 'application_to_class_class',
143 default => 'Moose::Meta::Role::Application::ToClass',
144 Class::MOP::_definition_context(),
147 $META->add_attribute(
148 'application_to_role_class',
149 reader => 'application_to_role_class',
150 default => 'Moose::Meta::Role::Application::ToRole',
151 Class::MOP::_definition_context(),
154 $META->add_attribute(
155 'application_to_instance_class',
156 reader => 'application_to_instance_class',
157 default => 'Moose::Meta::Role::Application::ToInstance',
158 Class::MOP::_definition_context(),
161 $META->add_attribute(
162 'applied_attribute_metaclass',
163 reader => 'applied_attribute_metaclass',
164 default => 'Moose::Meta::Attribute',
165 Class::MOP::_definition_context(),
168 # More or less copied from Moose::Meta::Class
172 unshift @args, 'package' if @args % 2;
174 my $package = delete $opts{package};
175 return Class::MOP::get_metaclass_by_name($package)
176 || $class->SUPER::initialize($package,
177 'attribute_metaclass' => 'Moose::Meta::Role::Attribute',
186 my $meta = blessed $pkg ? $pkg : Class::MOP::class_of($pkg);
188 my %existing_classes;
190 %existing_classes = map { $_ => $meta->$_() } qw(
193 wrapped_method_metaclass
194 required_method_metaclass
195 conflicting_method_metaclass
196 application_to_class_class
197 application_to_role_class
198 application_to_instance_class
199 applied_attribute_metaclass
204 $options{weaken} = Class::MOP::metaclass_is_weak($meta->name)
205 if !exists $options{weaken}
207 && $meta->isa('Moose::Meta::Role');
209 # don't need to remove generated metaobjects here yet, since we don't
210 # yet generate anything in roles. this may change in the future though...
211 # keep an eye on that
212 my $new_meta = $self->SUPER::reinitialize(
217 $new_meta->_restore_metaobjects_from($meta)
218 if $meta && $meta->isa('Moose::Meta::Role');
222 sub _restore_metaobjects_from {
226 $self->_restore_metamethods_from($old_meta);
227 $self->_restore_metaattributes_from($old_meta);
229 for my $role ( @{ $old_meta->get_roles } ) {
230 $self->add_role($role);
237 if (blessed $_[0] && ! $_[0]->isa('Moose::Meta::Role::Attribute') ) {
238 my $class = ref $_[0];
239 Moose->throw_error( "Cannot add a $class as an attribute to a role" );
241 elsif (!blessed($_[0]) && defined($_[0]) && $_[0] =~ /^\+(.*)/) {
242 Moose->throw_error( "has '+attr' is not supported in roles" );
245 return $self->SUPER::add_attribute(@_);
248 sub _attach_attribute {
249 my ( $self, $attribute ) = @_;
251 $attribute->attach_to_role($self);
254 sub add_required_methods {
259 if (!blessed($method)) {
260 $method = $self->required_method_metaclass->new(
264 $self->get_required_methods_map->{$method->name} = $method;
268 sub add_conflicting_method {
272 if (@_ == 1 && blessed($_[0])) {
276 $method = $self->conflicting_method_metaclass->new(@_);
279 $self->add_required_methods($method);
282 ## ------------------------------------------------------------------
286 # the before/around/after method modifiers are
287 # stored by name, but there can be many methods
288 # then associated with that name. So again we have
289 # lots of similar functionality, so we can do some
290 # meta-programmin' and save some time.
293 foreach my $modifier_type (qw[ before around after ]) {
295 my $attr_reader = "get_${modifier_type}_method_modifiers_map";
297 # create the attribute ...
298 $META->add_attribute("${modifier_type}_method_modifiers" => (
299 reader => $attr_reader,
300 default => sub { {} },
301 Class::MOP::_definition_context(),
304 # and some helper methods ...
305 $META->add_method("get_${modifier_type}_method_modifiers" => sub {
306 my ($self, $method_name) = @_;
307 #return () unless exists $self->$attr_reader->{$method_name};
308 my $mm = $self->$attr_reader->{$method_name};
312 $META->add_method("has_${modifier_type}_method_modifiers" => sub {
313 my ($self, $method_name) = @_;
315 # for now we assume that if it exists,..
316 # it has at least one modifier in it
317 (exists $self->$attr_reader->{$method_name}) ? 1 : 0;
320 $META->add_method("add_${modifier_type}_method_modifier" => sub {
321 my ($self, $method_name, $method) = @_;
323 $self->$attr_reader->{$method_name} = []
324 unless exists $self->$attr_reader->{$method_name};
326 my $modifiers = $self->$attr_reader->{$method_name};
329 # check to see that we aren't adding the
330 # same code twice. We err in favor of the
331 # first on here, this may not be as expected
332 foreach my $modifier (@{$modifiers}) {
333 return if $modifier == $method;
336 push @{$modifiers} => $method;
341 ## ------------------------------------------------------------------
342 ## override method mofidiers
344 $META->add_attribute('override_method_modifiers' => (
345 reader => 'get_override_method_modifiers_map',
346 default => sub { {} },
347 Class::MOP::_definition_context(),
351 # these are a little different because there
352 # can only be one per name, whereas the other
353 # method modifiers can have multiples.
356 sub add_override_method_modifier {
357 my ($self, $method_name, $method) = @_;
358 (!$self->has_method($method_name))
359 || Moose->throw_error("Cannot add an override of method '$method_name' " .
360 "because there is a local version of '$method_name'");
361 $self->get_override_method_modifiers_map->{$method_name} = $method;
364 sub has_override_method_modifier {
365 my ($self, $method_name) = @_;
367 # for now we assume that if it exists,..
368 # it has at least one modifier in it
369 (exists $self->get_override_method_modifiers_map->{$method_name}) ? 1 : 0;
372 sub get_override_method_modifier {
373 my ($self, $method_name) = @_;
374 $self->get_override_method_modifiers_map->{$method_name};
377 ## general list accessor ...
379 sub get_method_modifier_list {
380 my ($self, $modifier_type) = @_;
381 my $accessor = "get_${modifier_type}_method_modifiers_map";
382 keys %{$self->$accessor};
385 sub _meta_method_class { 'Moose::Meta::Method::Meta' }
387 ## ------------------------------------------------------------------
390 $META->add_attribute('roles' => (
391 reader => 'get_roles',
392 default => sub { [] },
393 Class::MOP::_definition_context(),
397 my ($self, $role) = @_;
398 (blessed($role) && $role->isa('Moose::Meta::Role'))
399 || Moose->throw_error("Roles must be instances of Moose::Meta::Role");
400 push @{$self->get_roles} => $role;
401 $self->reset_package_cache_flag;
404 sub calculate_all_roles {
410 $_->calculate_all_roles
411 } @{ $self->get_roles });
415 my ($self, $role) = @_;
417 || Moose->throw_error("You must supply a role name to look for");
418 my $role_name = blessed $role ? $role->name : $role;
419 # if we are it,.. then return true
420 return 1 if $role_name eq $self->name;
421 # otherwise.. check our children
422 foreach my $role (@{$self->get_roles}) {
423 return 1 if $role->does_role($role_name);
428 sub find_method_by_name { (shift)->get_method(@_) }
430 ## ------------------------------------------------------------------
432 ## ------------------------------------------------------------------
435 my ($self, $other, %args) = @_;
438 || Moose->throw_error("You must pass in an blessed instance");
440 my $application_class;
441 if ($other->isa('Moose::Meta::Role')) {
442 $application_class = $self->application_to_role_class;
444 elsif ($other->isa('Moose::Meta::Class')) {
445 $application_class = $self->application_to_class_class;
448 $application_class = $self->application_to_instance_class;
451 load_class($application_class);
453 if ( exists $args{'-excludes'} ) {
454 # I wish we had coercion here :)
455 $args{'-excludes'} = (
456 ref $args{'-excludes'} eq 'ARRAY'
458 : [ $args{'-excludes'} ]
462 return $application_class->new(%args)->apply($self, $other, \%args);
465 sub composition_class_roles { }
468 my ($class, @role_specs) = @_;
470 require Moose::Meta::Role::Composite;
472 my (@roles, %role_params);
473 while (@role_specs) {
474 my ($role, $params) = @{ splice @role_specs, 0, 1 };
478 : Class::MOP::class_of($role);
480 my $actual_role = $requested_role->_role_for_combination($params);
481 push @roles => $actual_role;
483 next unless defined $params;
484 $role_params{$actual_role->name} = $params;
487 my $c = Moose::Meta::Role::Composite->new(roles => \@roles);
488 return $c->apply_params(\%role_params);
491 sub _role_for_combination {
492 my ($self, $params) = @_;
500 unshift @args, 'package' if @args % 2 == 1;
503 (ref $options{attributes} eq 'HASH')
504 || confess "You must pass a HASH ref of attributes"
505 if exists $options{attributes};
507 (ref $options{methods} eq 'HASH')
508 || confess "You must pass a HASH ref of methods"
509 if exists $options{methods};
511 (ref $options{roles} eq 'ARRAY')
512 || confess "You must pass an ARRAY ref of roles"
513 if exists $options{roles};
515 my $package = delete $options{package};
516 my $roles = delete $options{roles};
517 my $attributes = delete $options{attributes};
518 my $methods = delete $options{methods};
519 my $meta_name = exists $options{meta_name}
520 ? delete $options{meta_name}
523 my $meta = $class->SUPER::create($package => %options);
525 $meta->_add_meta_method($meta_name)
526 if defined $meta_name;
528 if (defined $attributes) {
529 foreach my $attribute_name (keys %{$attributes}) {
530 my $attr = $attributes->{$attribute_name};
531 $meta->add_attribute(
532 $attribute_name => blessed $attr ? $attr : %{$attr} );
536 if (defined $methods) {
537 foreach my $method_name (keys %{$methods}) {
538 $meta->add_method($method_name, $methods->{$method_name});
543 Moose::Util::apply_all_roles($meta, @$roles);
552 for my $meta (Class::MOP::get_all_metaclass_instances) {
553 next if $meta->name eq $self->name;
554 next unless $meta->isa('Moose::Meta::Class')
555 || $meta->isa('Moose::Meta::Role');
556 push @consumers, $meta->name
557 if $meta->does_role($self->name);
562 # XXX: something more intelligent here?
563 sub _anon_package_prefix { 'Moose::Meta::Role::__ANON__::SERIAL::' }
565 sub create_anon_role { shift->create_anon(@_) }
566 sub is_anon_role { shift->is_anon(@_) }
568 sub _anon_cache_key {
572 # XXX fix this duplication (see MMC::_anon_cache_key
573 my $roles = Data::OptList::mkopt(($options{roles} || []), {
575 val_test => sub { ref($_[0]) eq 'HASH' },
579 for my $role_spec (@$roles) {
580 my ($role, $params) = @$role_spec;
581 $params = { %$params };
583 my $key = blessed($role) ? $role->name : $role;
585 if ($params && %$params) {
586 my $alias = delete $params->{'-alias'}
587 || delete $params->{'alias'}
589 my $excludes = delete $params->{'-excludes'}
590 || delete $params->{'excludes'}
592 $excludes = [$excludes] unless ref($excludes) eq 'ARRAY';
595 warn "Roles with parameters cannot be cached. Consider "
596 . "applying the parameters before calling "
597 . "create_anon_class, or using 'weaken => 0' instead";
601 my $alias_key = join('%',
602 map { $_ => $alias->{$_} } sort keys %$alias
604 my $excludes_key = join('%',
607 $key .= '<' . join('+', 'a', $alias_key, 'e', $excludes_key) . '>';
610 push @role_keys, $key;
613 # Makes something like Role|Role::1
614 return join('|', sort @role_keys);
617 #####################################################################
619 ## This is Moose::Meta::Role as defined by Moose (plus the use of
620 ## MooseX::AttributeHelpers module). It is here as a reference to
621 ## make it easier to see what is happening above with all the meta
623 #####################################################################
626 # metaclass => 'Array',
627 # reader => 'get_roles',
628 # isa => 'ArrayRef[Moose::Meta::Role]',
629 # default => sub { [] },
631 # 'push' => 'add_role',
635 # has 'excluded_roles_map' => (
636 # metaclass => 'Hash',
637 # reader => 'get_excluded_roles_map',
638 # isa => 'HashRef[Str]',
640 # # Not exactly set, cause it sets multiple
641 # 'set' => 'add_excluded_roles',
642 # 'keys' => 'get_excluded_roles_list',
643 # 'exists' => 'excludes_role',
647 # has 'required_methods' => (
648 # metaclass => 'Hash',
649 # reader => 'get_required_methods_map',
650 # isa => 'HashRef[Moose::Meta::Role::Method::Required]',
652 # # not exactly set, or delete since it works for multiple
653 # 'set' => 'add_required_methods',
654 # 'delete' => 'remove_required_methods',
655 # 'keys' => 'get_required_method_list',
656 # 'exists' => 'requires_method',
660 # # the before, around and after modifiers are
661 # # HASH keyed by method-name, with ARRAY of
662 # # CODE refs to apply in that order
664 # has 'before_method_modifiers' => (
665 # metaclass => 'Hash',
666 # reader => 'get_before_method_modifiers_map',
667 # isa => 'HashRef[ArrayRef[CodeRef]]',
669 # 'keys' => 'get_before_method_modifiers',
670 # 'exists' => 'has_before_method_modifiers',
671 # # This actually makes sure there is an
672 # # ARRAY at the given key, and pushed onto
673 # # it. It also checks for duplicates as well
674 # # 'add' => 'add_before_method_modifier'
678 # has 'after_method_modifiers' => (
679 # metaclass => 'Hash',
680 # reader =>'get_after_method_modifiers_map',
681 # isa => 'HashRef[ArrayRef[CodeRef]]',
683 # 'keys' => 'get_after_method_modifiers',
684 # 'exists' => 'has_after_method_modifiers',
685 # # This actually makes sure there is an
686 # # ARRAY at the given key, and pushed onto
687 # # it. It also checks for duplicates as well
688 # # 'add' => 'add_after_method_modifier'
692 # has 'around_method_modifiers' => (
693 # metaclass => 'Hash',
694 # reader =>'get_around_method_modifiers_map',
695 # isa => 'HashRef[ArrayRef[CodeRef]]',
697 # 'keys' => 'get_around_method_modifiers',
698 # 'exists' => 'has_around_method_modifiers',
699 # # This actually makes sure there is an
700 # # ARRAY at the given key, and pushed onto
701 # # it. It also checks for duplicates as well
702 # # 'add' => 'add_around_method_modifier'
706 # # override is similar to the other modifiers
707 # # except that it is not an ARRAY of code refs
708 # # but instead just a single name->code mapping
710 # has 'override_method_modifiers' => (
711 # metaclass => 'Hash',
712 # reader =>'get_override_method_modifiers_map',
713 # isa => 'HashRef[CodeRef]',
715 # 'keys' => 'get_override_method_modifier',
716 # 'exists' => 'has_override_method_modifier',
717 # 'add' => 'add_override_method_modifier', # checks for local method ..
721 #####################################################################
726 # ABSTRACT: The Moose Role metaclass
734 This class is a subclass of L<Class::MOP::Module> that provides
735 additional Moose-specific functionality.
737 Its API looks a lot like L<Moose::Meta::Class>, but internally it
738 implements many things differently. This may change in the future.
742 C<Moose::Meta::Role> is a subclass of L<Class::MOP::Module>.
750 =item B<< Moose::Meta::Role->initialize($role_name) >>
752 This method creates a new role object with the provided name.
754 =item B<< Moose::Meta::Role->combine( [ $role => { ... } ], [ $role ], ... ) >>
756 This method accepts a list of array references. Each array reference
757 should contain a role name or L<Moose::Meta::Role> object as its first element. The second element is
758 an optional hash reference. The hash reference can contain C<-excludes>
759 and C<-alias> keys to control how methods are composed from the role.
761 The return value is a new L<Moose::Meta::Role::Composite> that
762 represents the combined roles.
764 =item B<< $metarole->composition_class_roles >>
766 When combining multiple roles using C<combine>, this method is used to obtain a
767 list of role names to be applied to the L<Moose::Meta::Role::Composite>
768 instance returned by C<combine>. The default implementation returns an empty
769 list. Extensions that need to hook into role combination may wrap this method
770 to return additional role names.
772 =item B<< Moose::Meta::Role->create($name, %options) >>
774 This method is identical to the L<Moose::Meta::Class> C<create>
777 =item B<< Moose::Meta::Role->create_anon_role >>
779 This method is identical to the L<Moose::Meta::Class>
780 C<create_anon_class> method.
782 =item B<< $metarole->is_anon_role >>
784 Returns true if the role is an anonymous role.
786 =item B<< $metarole->consumers >>
788 Returns a list of names of classes and roles which consume this role.
792 =head2 Role application
796 =item B<< $metarole->apply( $thing, @options ) >>
798 This method applies a role to the given C<$thing>. That can be another
799 L<Moose::Meta::Role>, object, a L<Moose::Meta::Class> object, or a
800 (non-meta) object instance.
802 The options are passed directly to the constructor for the appropriate
803 L<Moose::Meta::Role::Application> subclass.
805 Note that this will apply the role even if the C<$thing> in question already
806 C<does> this role. L<Moose::Util/does_role> is a convenient wrapper for
807 finding out if role application is necessary.
811 =head2 Roles and other roles
815 =item B<< $metarole->get_roles >>
817 This returns an array reference of roles which this role does. This
818 list may include duplicates.
820 =item B<< $metarole->calculate_all_roles >>
822 This returns a I<unique> list of all roles that this role does, and
823 all the roles that its roles do.
825 =item B<< $metarole->does_role($role) >>
827 Given a role I<name> or L<Moose::Meta::Role> object, returns true if this role
830 =item B<< $metarole->add_role($role) >>
832 Given a L<Moose::Meta::Role> object, this adds the role to the list of
833 roles that the role does.
835 =item B<< $metarole->get_excluded_roles_list >>
837 Returns a list of role names which this role excludes.
839 =item B<< $metarole->excludes_role($role_name) >>
841 Given a role I<name>, returns true if this role excludes the named
844 =item B<< $metarole->add_excluded_roles(@role_names) >>
846 Given one or more role names, adds those roles to the list of excluded
853 The methods for dealing with a role's methods are all identical in API
854 and behavior to the same methods in L<Class::MOP::Class>.
858 =item B<< $metarole->method_metaclass >>
860 Returns the method metaclass name for the role. This defaults to
861 L<Moose::Meta::Role::Method>.
863 =item B<< $metarole->get_method($name) >>
865 =item B<< $metarole->has_method($name) >>
867 =item B<< $metarole->add_method( $name, $body ) >>
869 =item B<< $metarole->get_method_list >>
871 =item B<< $metarole->find_method_by_name($name) >>
873 These methods are all identical to the methods of the same name in
874 L<Class::MOP::Package>
880 As with methods, the methods for dealing with a role's attribute are
881 all identical in API and behavior to the same methods in
882 L<Class::MOP::Class>.
884 However, attributes stored in this class are I<not> stored as
885 objects. Rather, the attribute definition is stored as a hash
886 reference. When a role is composed into a class, this hash reference
887 is passed directly to the metaclass's C<add_attribute> method.
889 This is quite likely to change in the future.
893 =item B<< $metarole->get_attribute($attribute_name) >>
895 =item B<< $metarole->has_attribute($attribute_name) >>
897 =item B<< $metarole->get_attribute_list >>
899 =item B<< $metarole->add_attribute($name, %options) >>
901 =item B<< $metarole->remove_attribute($attribute_name) >>
905 =head2 Required methods
909 =item B<< $metarole->get_required_method_list >>
911 Returns the list of methods required by the role.
913 =item B<< $metarole->requires_method($name) >>
915 Returns true if the role requires the named method.
917 =item B<< $metarole->add_required_methods(@names) >>
919 Adds the named methods to the role's list of required methods.
921 =item B<< $metarole->remove_required_methods(@names) >>
923 Removes the named methods from the role's list of required methods.
925 =item B<< $metarole->add_conflicting_method(%params) >>
927 Instantiate the parameters as a L<Moose::Meta::Role::Method::Conflicting>
928 object, then add it to the required method list.
932 =head2 Method modifiers
934 These methods act like their counterparts in L<Class::MOP::Class> and
935 L<Moose::Meta::Class>.
937 However, method modifiers are simply stored internally, and are not
938 applied until the role itself is applied to a class.
942 =item B<< $metarole->add_after_method_modifier($method_name, $method) >>
944 =item B<< $metarole->add_around_method_modifier($method_name, $method) >>
946 =item B<< $metarole->add_before_method_modifier($method_name, $method) >>
948 =item B<< $metarole->add_override_method_modifier($method_name, $method) >>
950 These methods all add an appropriate modifier to the internal list of
953 =item B<< $metarole->has_after_method_modifiers >>
955 =item B<< $metarole->has_around_method_modifiers >>
957 =item B<< $metarole->has_before_method_modifiers >>
959 =item B<< $metarole->has_override_method_modifier >>
961 Return true if the role has any modifiers of the given type.
963 =item B<< $metarole->get_after_method_modifiers($method_name) >>
965 =item B<< $metarole->get_around_method_modifiers($method_name) >>
967 =item B<< $metarole->get_before_method_modifiers($method_name) >>
969 Given a method name, returns a list of the appropriate modifiers for
972 =item B<< $metarole->get_override_method_modifier($method_name) >>
974 Given a method name, returns the override method modifier for that
975 method, if it has one.
983 =item B<< Moose::Meta::Role->meta >>
985 This will return a L<Class::MOP::Class> instance for this class.
991 See L<Moose/BUGS> for details on reporting bugs.