2 package Moose::Meta::Role;
8 use Scalar::Util 'blessed';
10 use Devel::GlobalDestruction 'in_global_destruction';
12 our $VERSION = '1.15';
13 $VERSION = eval $VERSION;
14 our $AUTHORITY = 'cpan:STEVAN';
16 use Moose::Meta::Class;
17 use Moose::Meta::Role::Attribute;
18 use Moose::Meta::Role::Method;
19 use Moose::Meta::Role::Method::Required;
20 use Moose::Meta::Role::Method::Conflicting;
21 use Moose::Meta::Method::Meta;
22 use Moose::Util qw( ensure_all_roles );
23 use Class::MOP::MiniTrait;
25 use base 'Class::MOP::Module',
26 'Class::MOP::Mixin::HasAttributes',
27 'Class::MOP::Mixin::HasMethods';
29 Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
31 ## ------------------------------------------------------------------
33 ## I normally don't do this, but I am doing
34 ## a whole bunch of meta-programmin in this
35 ## module, so it just makes sense. For a clearer
36 ## picture of what is going on in the next
37 ## several lines of code, look at the really
38 ## big comment at the end of this file (right
41 ## ------------------------------------------------------------------
43 my $META = __PACKAGE__->meta;
45 ## ------------------------------------------------------------------
49 # since roles are lazy, we hold all the attributes
50 # of the individual role in 'statis' until which
51 # time when it is applied to a class. This means
52 # keeping a lot of things in hash maps, so we are
53 # using a little of that meta-programmin' magic
54 # here an saving lots of extra typin. And since
55 # many of these attributes above require similar
56 # functionality to support them, so we again use
57 # the wonders of meta-programmin' to deliver a
58 # very compact solution to this normally verbose
64 name => 'excluded_roles_map',
65 attr_reader => 'get_excluded_roles_map' ,
67 add => 'add_excluded_roles',
68 get_keys => 'get_excluded_roles_list',
69 existence => 'excludes_role',
73 name => 'required_methods',
74 attr_reader => 'get_required_methods_map',
76 remove => 'remove_required_methods',
77 get_values => 'get_required_method_list',
78 existence => 'requires_method',
83 my $attr_reader = $action->{attr_reader};
84 my $methods = $action->{methods};
86 # create the attribute
87 $META->add_attribute($action->{name} => (
88 reader => $attr_reader,
92 # create some helper methods
93 $META->add_method($methods->{add} => sub {
94 my ($self, @values) = @_;
95 $self->$attr_reader->{$_} = undef foreach @values;
96 }) if exists $methods->{add};
98 $META->add_method($methods->{get_keys} => sub {
100 keys %{$self->$attr_reader};
101 }) if exists $methods->{get_keys};
103 $META->add_method($methods->{get_values} => sub {
105 values %{$self->$attr_reader};
106 }) if exists $methods->{get_values};
108 $META->add_method($methods->{get} => sub {
109 my ($self, $name) = @_;
110 $self->$attr_reader->{$name}
111 }) if exists $methods->{get};
113 $META->add_method($methods->{existence} => sub {
114 my ($self, $name) = @_;
115 exists $self->$attr_reader->{$name} ? 1 : 0;
116 }) if exists $methods->{existence};
118 $META->add_method($methods->{remove} => sub {
119 my ($self, @values) = @_;
120 delete $self->$attr_reader->{$_} foreach @values;
121 }) if exists $methods->{remove};
124 $META->add_attribute(
126 reader => 'method_metaclass',
127 default => 'Moose::Meta::Role::Method',
130 $META->add_attribute(
131 'required_method_metaclass',
132 reader => 'required_method_metaclass',
133 default => 'Moose::Meta::Role::Method::Required',
136 $META->add_attribute(
137 'conflicting_method_metaclass',
138 reader => 'conflicting_method_metaclass',
139 default => 'Moose::Meta::Role::Method::Conflicting',
142 $META->add_attribute(
143 'application_to_class_class',
144 reader => 'application_to_class_class',
145 default => 'Moose::Meta::Role::Application::ToClass',
148 $META->add_attribute(
149 'application_to_role_class',
150 reader => 'application_to_role_class',
151 default => 'Moose::Meta::Role::Application::ToRole',
154 $META->add_attribute(
155 'application_to_instance_class',
156 reader => 'application_to_instance_class',
157 default => 'Moose::Meta::Role::Application::ToInstance',
160 # More or less copied from Moose::Meta::Class
165 if (defined(my $meta = Class::MOP::get_metaclass_by_name($pkg))) {
171 my $meta = $class->SUPER::initialize(
173 'attribute_metaclass' => 'Moose::Meta::Role::Attribute',
177 Class::MOP::weaken_metaclass($pkg) if $options{weaken};
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
203 $options{weaken} = Class::MOP::metaclass_is_weak($meta->name)
204 if !exists $options{weaken}
206 && $meta->isa('Moose::Meta::Role');
208 # don't need to remove generated metaobjects here yet, since we don't
209 # yet generate anything in roles. this may change in the future though...
210 # keep an eye on that
211 my $new_meta = $self->SUPER::reinitialize(
216 $new_meta->_restore_metaobjects_from($meta)
217 if $meta && $meta->isa('Moose::Meta::Role');
221 sub _restore_metaobjects_from {
225 $self->_restore_metamethods_from($old_meta);
226 $self->_restore_metaattributes_from($old_meta);
232 if (blessed $_[0] && ! $_[0]->isa('Moose::Meta::Role::Attribute') ) {
233 my $class = ref $_[0];
234 Moose->throw_error( "Cannot add a $class as an attribute to a role" );
236 elsif (!blessed($_[0]) && defined($_[0]) && $_[0] =~ /^\+(.*)/) {
237 Moose->throw_error( "has '+attr' is not supported in roles" );
240 return $self->SUPER::add_attribute(@_);
243 sub _attach_attribute {
244 my ( $self, $attribute ) = @_;
246 $attribute->attach_to_role($self);
249 sub add_required_methods {
254 if (!blessed($method)) {
255 $method = $self->required_method_metaclass->new(
259 $self->get_required_methods_map->{$method->name} = $method;
263 sub add_conflicting_method {
267 if (@_ == 1 && blessed($_[0])) {
271 $method = $self->conflicting_method_metaclass->new(@_);
274 $self->add_required_methods($method);
277 ## ------------------------------------------------------------------
281 # the before/around/after method modifiers are
282 # stored by name, but there can be many methods
283 # then associated with that name. So again we have
284 # lots of similar functionality, so we can do some
285 # meta-programmin' and save some time.
288 foreach my $modifier_type (qw[ before around after ]) {
290 my $attr_reader = "get_${modifier_type}_method_modifiers_map";
292 # create the attribute ...
293 $META->add_attribute("${modifier_type}_method_modifiers" => (
294 reader => $attr_reader,
295 default => sub { {} }
298 # and some helper methods ...
299 $META->add_method("get_${modifier_type}_method_modifiers" => sub {
300 my ($self, $method_name) = @_;
301 #return () unless exists $self->$attr_reader->{$method_name};
302 my $mm = $self->$attr_reader->{$method_name};
306 $META->add_method("has_${modifier_type}_method_modifiers" => sub {
307 my ($self, $method_name) = @_;
309 # for now we assume that if it exists,..
310 # it has at least one modifier in it
311 (exists $self->$attr_reader->{$method_name}) ? 1 : 0;
314 $META->add_method("add_${modifier_type}_method_modifier" => sub {
315 my ($self, $method_name, $method) = @_;
317 $self->$attr_reader->{$method_name} = []
318 unless exists $self->$attr_reader->{$method_name};
320 my $modifiers = $self->$attr_reader->{$method_name};
323 # check to see that we aren't adding the
324 # same code twice. We err in favor of the
325 # first on here, this may not be as expected
326 foreach my $modifier (@{$modifiers}) {
327 return if $modifier == $method;
330 push @{$modifiers} => $method;
335 ## ------------------------------------------------------------------
336 ## override method mofidiers
338 $META->add_attribute('override_method_modifiers' => (
339 reader => 'get_override_method_modifiers_map',
340 default => sub { {} }
344 # these are a little different because there
345 # can only be one per name, whereas the other
346 # method modifiers can have multiples.
349 sub add_override_method_modifier {
350 my ($self, $method_name, $method) = @_;
351 (!$self->has_method($method_name))
352 || Moose->throw_error("Cannot add an override of method '$method_name' " .
353 "because there is a local version of '$method_name'");
354 $self->get_override_method_modifiers_map->{$method_name} = $method;
357 sub has_override_method_modifier {
358 my ($self, $method_name) = @_;
360 # for now we assume that if it exists,..
361 # it has at least one modifier in it
362 (exists $self->get_override_method_modifiers_map->{$method_name}) ? 1 : 0;
365 sub get_override_method_modifier {
366 my ($self, $method_name) = @_;
367 $self->get_override_method_modifiers_map->{$method_name};
370 ## general list accessor ...
372 sub get_method_modifier_list {
373 my ($self, $modifier_type) = @_;
374 my $accessor = "get_${modifier_type}_method_modifiers_map";
375 keys %{$self->$accessor};
378 sub reset_package_cache_flag { (shift)->{'_package_cache_flag'} = undef }
379 sub update_package_cache_flag {
381 $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name);
385 sub _meta_method_class { 'Moose::Meta::Method::Meta' }
387 ## ------------------------------------------------------------------
390 $META->add_attribute('roles' => (
391 reader => 'get_roles',
392 default => sub { [] }
396 my ($self, $role) = @_;
397 (blessed($role) && $role->isa('Moose::Meta::Role'))
398 || Moose->throw_error("Roles must be instances of Moose::Meta::Role");
399 push @{$self->get_roles} => $role;
400 $self->reset_package_cache_flag;
403 sub calculate_all_roles {
409 $_->calculate_all_roles
410 } @{ $self->get_roles });
414 my ($self, $role) = @_;
416 || Moose->throw_error("You must supply a role name to look for");
417 my $role_name = blessed $role ? $role->name : $role;
418 # if we are it,.. then return true
419 return 1 if $role_name eq $self->name;
420 # otherwise.. check our children
421 foreach my $role (@{$self->get_roles}) {
422 return 1 if $role->does_role($role_name);
427 sub find_method_by_name { (shift)->get_method(@_) }
429 ## ------------------------------------------------------------------
431 ## ------------------------------------------------------------------
434 my ($self, $other, %args) = @_;
437 || Moose->throw_error("You must pass in an blessed instance");
439 my $application_class;
440 if ($other->isa('Moose::Meta::Role')) {
441 $application_class = $self->application_to_role_class;
443 elsif ($other->isa('Moose::Meta::Class')) {
444 $application_class = $self->application_to_class_class;
447 $application_class = $self->application_to_instance_class;
450 Class::MOP::load_class($application_class);
451 return $application_class->new(%args)->apply($self, $other, \%args);
454 sub composition_class_roles { }
457 my ($class, @role_specs) = @_;
459 require Moose::Meta::Role::Composite;
461 my (@roles, %role_params);
462 while (@role_specs) {
463 my ($role, $params) = @{ splice @role_specs, 0, 1 };
467 : Class::MOP::class_of($role);
469 my $actual_role = $requested_role->_role_for_combination($params);
470 push @roles => $actual_role;
472 next unless defined $params;
473 $role_params{$actual_role->name} = $params;
476 my $c = Moose::Meta::Role::Composite->new(roles => \@roles);
477 return $c->apply_params(\%role_params);
480 sub _role_for_combination {
481 my ($self, $params) = @_;
486 my ( $role, $package_name, %options ) = @_;
488 $options{package} = $package_name;
490 (ref $options{attributes} eq 'HASH')
491 || confess "You must pass a HASH ref of attributes"
492 if exists $options{attributes};
494 (ref $options{methods} eq 'HASH')
495 || confess "You must pass a HASH ref of methods"
496 if exists $options{methods};
498 $options{meta_name} = 'meta'
499 unless exists $options{meta_name};
501 my (%initialize_options) = %options;
502 delete @initialize_options{qw(
511 my $meta = $role->initialize( $package_name => %initialize_options );
513 $meta->_instantiate_module( $options{version}, $options{authority} );
515 $meta->_add_meta_method($options{meta_name})
516 if defined $options{meta_name};
518 if (exists $options{attributes}) {
519 foreach my $attribute_name (keys %{$options{attributes}}) {
520 my $attr = $options{attributes}->{$attribute_name};
521 $meta->add_attribute(
522 $attribute_name => blessed $attr ? $attr : %{$attr} );
526 if (exists $options{methods}) {
527 foreach my $method_name (keys %{$options{methods}}) {
528 $meta->add_method($method_name, $options{methods}->{$method_name});
538 for my $meta (Class::MOP::get_all_metaclass_instances) {
539 next if $meta->name eq $self->name;
540 next unless $meta->isa('Moose::Meta::Class')
541 || $meta->isa('Moose::Meta::Role');
542 push @consumers, $meta->name
543 if $meta->does_role($self->name);
548 # anonymous roles. most of it is copied straight out of Class::MOP::Class.
549 # an intrepid hacker might find great riches if he unifies this code with that
550 # code in Class::MOP::Module or Class::MOP::Package
553 # this should be sufficient, if you have a
554 # use case where it is not, write a test and
556 my $ANON_ROLE_SERIAL = 0;
559 # we need a sufficiently annoying prefix
560 # this should suffice for now, this is
561 # used in a couple of places below, so
562 # need to put it up here for now.
563 my $ANON_ROLE_PREFIX = 'Moose::Meta::Role::__ANON__::SERIAL::';
567 no warnings 'uninitialized';
568 $self->name =~ /^$ANON_ROLE_PREFIX/;
571 sub create_anon_role {
572 my ($role, %options) = @_;
573 $options{weaken} = 1 unless exists $options{weaken};
574 my $package_name = $ANON_ROLE_PREFIX . ++$ANON_ROLE_SERIAL;
575 return $role->create($package_name, %options);
579 # this will only get called for
580 # anon-roles, all other calls
581 # are assumed to occur during
582 # global destruction and so don't
583 # really need to be handled explicitly
587 return if in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated
589 no warnings 'uninitialized';
590 return unless $self->name =~ /^$ANON_ROLE_PREFIX/;
592 # XXX: is this necessary for us? I don't understand what it's doing
595 # Moose does a weird thing where it replaces the metaclass for
596 # class when fixing metaclass incompatibility. In that case,
597 # we don't want to clean out the namespace now. We can detect
598 # that because Moose will explicitly update the singleton
599 # cache in Class::MOP.
600 #my $current_meta = Class::MOP::get_metaclass_by_name($self->name);
601 #return if $current_meta ne $self;
603 my ($serial_id) = ($self->name =~ /^$ANON_ROLE_PREFIX(\d+)/);
605 foreach my $key (keys %{$ANON_ROLE_PREFIX . $serial_id}) {
606 delete ${$ANON_ROLE_PREFIX . $serial_id}{$key};
608 delete ${'main::' . $ANON_ROLE_PREFIX}{$serial_id . '::'};
612 #####################################################################
614 ## This is Moose::Meta::Role as defined by Moose (plus the use of
615 ## MooseX::AttributeHelpers module). It is here as a reference to
616 ## make it easier to see what is happening above with all the meta
618 #####################################################################
621 # metaclass => 'Array',
622 # reader => 'get_roles',
623 # isa => 'ArrayRef[Moose::Meta::Role]',
624 # default => sub { [] },
626 # 'push' => 'add_role',
630 # has 'excluded_roles_map' => (
631 # metaclass => 'Hash',
632 # reader => 'get_excluded_roles_map',
633 # isa => 'HashRef[Str]',
635 # # Not exactly set, cause it sets multiple
636 # 'set' => 'add_excluded_roles',
637 # 'keys' => 'get_excluded_roles_list',
638 # 'exists' => 'excludes_role',
642 # has 'required_methods' => (
643 # metaclass => 'Hash',
644 # reader => 'get_required_methods_map',
645 # isa => 'HashRef[Moose::Meta::Role::Method::Required]',
647 # # not exactly set, or delete since it works for multiple
648 # 'set' => 'add_required_methods',
649 # 'delete' => 'remove_required_methods',
650 # 'keys' => 'get_required_method_list',
651 # 'exists' => 'requires_method',
655 # # the before, around and after modifiers are
656 # # HASH keyed by method-name, with ARRAY of
657 # # CODE refs to apply in that order
659 # has 'before_method_modifiers' => (
660 # metaclass => 'Hash',
661 # reader => 'get_before_method_modifiers_map',
662 # isa => 'HashRef[ArrayRef[CodeRef]]',
664 # 'keys' => 'get_before_method_modifiers',
665 # 'exists' => 'has_before_method_modifiers',
666 # # This actually makes sure there is an
667 # # ARRAY at the given key, and pushed onto
668 # # it. It also checks for duplicates as well
669 # # 'add' => 'add_before_method_modifier'
673 # has 'after_method_modifiers' => (
674 # metaclass => 'Hash',
675 # reader =>'get_after_method_modifiers_map',
676 # isa => 'HashRef[ArrayRef[CodeRef]]',
678 # 'keys' => 'get_after_method_modifiers',
679 # 'exists' => 'has_after_method_modifiers',
680 # # This actually makes sure there is an
681 # # ARRAY at the given key, and pushed onto
682 # # it. It also checks for duplicates as well
683 # # 'add' => 'add_after_method_modifier'
687 # has 'around_method_modifiers' => (
688 # metaclass => 'Hash',
689 # reader =>'get_around_method_modifiers_map',
690 # isa => 'HashRef[ArrayRef[CodeRef]]',
692 # 'keys' => 'get_around_method_modifiers',
693 # 'exists' => 'has_around_method_modifiers',
694 # # This actually makes sure there is an
695 # # ARRAY at the given key, and pushed onto
696 # # it. It also checks for duplicates as well
697 # # 'add' => 'add_around_method_modifier'
701 # # override is similar to the other modifiers
702 # # except that it is not an ARRAY of code refs
703 # # but instead just a single name->code mapping
705 # has 'override_method_modifiers' => (
706 # metaclass => 'Hash',
707 # reader =>'get_override_method_modifiers_map',
708 # isa => 'HashRef[CodeRef]',
710 # 'keys' => 'get_override_method_modifier',
711 # 'exists' => 'has_override_method_modifier',
712 # 'add' => 'add_override_method_modifier', # checks for local method ..
716 #####################################################################
727 Moose::Meta::Role - The Moose Role metaclass
731 This class is a subclass of L<Class::MOP::Module> that provides
732 additional Moose-specific functionality.
734 It's API looks a lot like L<Moose::Meta::Class>, but internally it
735 implements many things differently. This may change in the future.
739 C<Moose::Meta::Role> is a subclass of L<Class::MOP::Module>.
747 =item B<< Moose::Meta::Role->initialize($role_name) >>
749 This method creates a new role object with the provided name.
751 =item B<< Moose::Meta::Role->combine( [ $role => { ... } ], [ $role ], ... ) >>
753 This method accepts a list of array references. Each array reference
754 should contain a role name or L<Moose::Meta::Role> object as its first element. The second element is
755 an optional hash reference. The hash reference can contain C<-excludes>
756 and C<-alias> keys to control how methods are composed from the role.
758 The return value is a new L<Moose::Meta::Role::Composite> that
759 represents the combined roles.
761 =item B<< $metarole->composition_class_roles >>
763 When combining multiple roles using C<combine>, this method is used to obtain a
764 list of role names to be applied to the L<Moose::Meta::Role::Composite>
765 instance returned by C<combine>. The default implementation returns an empty
766 list. Extensions that need to hook into role combination may wrap this method
767 to return additional role names.
769 =item B<< Moose::Meta::Role->create($name, %options) >>
771 This method is identical to the L<Moose::Meta::Class> C<create>
774 =item B<< Moose::Meta::Role->create_anon_role >>
776 This method is identical to the L<Moose::Meta::Class>
777 C<create_anon_class> method.
779 =item B<< $metarole->is_anon_role >>
781 Returns true if the role is an anonymous role.
783 =item B<< $metarole->consumers >>
785 Returns a list of names of classes and roles which consume this role.
789 =head2 Role application
793 =item B<< $metarole->apply( $thing, @options ) >>
795 This method applies a role to the given C<$thing>. That can be another
796 L<Moose::Meta::Role>, object, a L<Moose::Meta::Class> object, or a
797 (non-meta) object instance.
799 The options are passed directly to the constructor for the appropriate
800 L<Moose::Meta::Role::Application> subclass.
802 Note that this will apply the role even if the C<$thing> in question already
803 C<does> this role. L<Moose::Util/does_role> is a convenient wrapper for
804 finding out if role application is necessary.
808 =head2 Roles and other roles
812 =item B<< $metarole->get_roles >>
814 This returns an array reference of roles which this role does. This
815 list may include duplicates.
817 =item B<< $metarole->calculate_all_roles >>
819 This returns a I<unique> list of all roles that this role does, and
820 all the roles that its roles do.
822 =item B<< $metarole->does_role($role) >>
824 Given a role I<name> or L<Moose::Meta::Role> object, returns true if this role
827 =item B<< $metarole->add_role($role) >>
829 Given a L<Moose::Meta::Role> object, this adds the role to the list of
830 roles that the role does.
832 =item B<< $metarole->get_excluded_roles_list >>
834 Returns a list of role names which this role excludes.
836 =item B<< $metarole->excludes_role($role_name) >>
838 Given a role I<name>, returns true if this role excludes the named
841 =item B<< $metarole->add_excluded_roles(@role_names) >>
843 Given one or more role names, adds those roles to the list of excluded
850 The methods for dealing with a role's methods are all identical in API
851 and behavior to the same methods in L<Class::MOP::Class>.
855 =item B<< $metarole->method_metaclass >>
857 Returns the method metaclass name for the role. This defaults to
858 L<Moose::Meta::Role::Method>.
860 =item B<< $metarole->get_method($name) >>
862 =item B<< $metarole->has_method($name) >>
864 =item B<< $metarole->add_method( $name, $body ) >>
866 =item B<< $metarole->get_method_list >>
868 =item B<< $metarole->find_method_by_name($name) >>
870 These methods are all identical to the methods of the same name in
871 L<Class::MOP::Package>
877 As with methods, the methods for dealing with a role's attribute are
878 all identical in API and behavior to the same methods in
879 L<Class::MOP::Class>.
881 However, attributes stored in this class are I<not> stored as
882 objects. Rather, the attribute definition is stored as a hash
883 reference. When a role is composed into a class, this hash reference
884 is passed directly to the metaclass's C<add_attribute> method.
886 This is quite likely to change in the future.
890 =item B<< $metarole->get_attribute($attribute_name) >>
892 =item B<< $metarole->has_attribute($attribute_name) >>
894 =item B<< $metarole->get_attribute_list >>
896 =item B<< $metarole->add_attribute($name, %options) >>
898 =item B<< $metarole->remove_attribute($attribute_name) >>
902 =head2 Required methods
906 =item B<< $metarole->get_required_method_list >>
908 Returns the list of methods required by the role.
910 =item B<< $metarole->requires_method($name) >>
912 Returns true if the role requires the named method.
914 =item B<< $metarole->add_required_methods(@names) >>
916 Adds the named methods to the role's list of required methods.
918 =item B<< $metarole->remove_required_methods(@names) >>
920 Removes the named methods from the role's list of required methods.
922 =item B<< $metarole->add_conflicting_method(%params) >>
924 Instantiate the parameters as a L<Moose::Meta::Role::Method::Conflicting>
925 object, then add it to the required method list.
929 =head2 Method modifiers
931 These methods act like their counterparts in L<Class::MOP::Class> and
932 L<Moose::Meta::Class>.
934 However, method modifiers are simply stored internally, and are not
935 applied until the role itself is applied to a class.
939 =item B<< $metarole->add_after_method_modifier($method_name, $method) >>
941 =item B<< $metarole->add_around_method_modifier($method_name, $method) >>
943 =item B<< $metarole->add_before_method_modifier($method_name, $method) >>
945 =item B<< $metarole->add_override_method_modifier($method_name, $method) >>
947 These methods all add an appropriate modifier to the internal list of
950 =item B<< $metarole->has_after_method_modifiers >>
952 =item B<< $metarole->has_around_method_modifiers >>
954 =item B<< $metarole->has_before_method_modifiers >>
956 =item B<< $metarole->has_override_method_modifier >>
958 Return true if the role has any modifiers of the given type.
960 =item B<< $metarole->get_after_method_modifiers($method_name) >>
962 =item B<< $metarole->get_around_method_modifiers($method_name) >>
964 =item B<< $metarole->get_before_method_modifiers($method_name) >>
966 Given a method name, returns a list of the appropriate modifiers for
969 =item B<< $metarole->get_override_method_modifier($method_name) >>
971 Given a method name, returns the override method modifier for that
972 method, if it has one.
980 =item B<< Moose::Meta::Role->meta >>
982 This will return a L<Class::MOP::Class> instance for this class.
988 See L<Moose/BUGS> for details on reporting bugs.
992 Stevan Little E<lt>stevan@iinteractive.comE<gt>
994 =head1 COPYRIGHT AND LICENSE
996 Copyright 2006-2010 by Infinity Interactive, Inc.
998 L<http://www.iinteractive.com>
1000 This library is free software; you can redistribute it and/or modify
1001 it under the same terms as Perl itself.