2 package Moose::Meta::Role;
8 use Scalar::Util 'blessed';
10 use Devel::GlobalDestruction 'in_global_destruction';
12 our $VERSION = '1.14';
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
164 return Class::MOP::get_metaclass_by_name($pkg)
165 || $class->SUPER::initialize(
167 'attribute_metaclass' => 'Moose::Meta::Role::Attribute',
176 my $meta = blessed $pkg ? $pkg : Class::MOP::class_of($pkg);
178 my %existing_classes;
180 %existing_classes = map { $_ => $meta->$_() } qw(
183 wrapped_method_metaclass
184 required_method_metaclass
185 conflicting_method_metaclass
186 application_to_class_class
187 application_to_role_class
188 application_to_instance_class
192 # don't need to remove generated metaobjects here yet, since we don't
193 # yet generate anything in roles. this may change in the future though...
194 # keep an eye on that
195 my $new_meta = $self->SUPER::reinitialize(
200 $new_meta->_restore_metaobjects_from($meta)
201 if $meta && $meta->isa('Moose::Meta::Role');
205 sub _restore_metaobjects_from {
209 $self->_restore_metamethods_from($old_meta);
210 $self->_restore_metaattributes_from($old_meta);
216 if (blessed $_[0] && ! $_[0]->isa('Moose::Meta::Role::Attribute') ) {
217 my $class = ref $_[0];
218 Moose->throw_error( "Cannot add a $class as an attribute to a role" );
220 elsif (!blessed($_[0]) && defined($_[0]) && $_[0] =~ /^\+(.*)/) {
221 Moose->throw_error( "has '+attr' is not supported in roles" );
224 return $self->SUPER::add_attribute(@_);
227 sub _attach_attribute {
228 my ( $self, $attribute ) = @_;
230 $attribute->attach_to_role($self);
233 sub add_required_methods {
238 if (!blessed($method)) {
239 $method = $self->required_method_metaclass->new(
243 $self->get_required_methods_map->{$method->name} = $method;
247 sub add_conflicting_method {
251 if (@_ == 1 && blessed($_[0])) {
255 $method = $self->conflicting_method_metaclass->new(@_);
258 $self->add_required_methods($method);
261 ## ------------------------------------------------------------------
265 # the before/around/after method modifiers are
266 # stored by name, but there can be many methods
267 # then associated with that name. So again we have
268 # lots of similar functionality, so we can do some
269 # meta-programmin' and save some time.
272 foreach my $modifier_type (qw[ before around after ]) {
274 my $attr_reader = "get_${modifier_type}_method_modifiers_map";
276 # create the attribute ...
277 $META->add_attribute("${modifier_type}_method_modifiers" => (
278 reader => $attr_reader,
279 default => sub { {} }
282 # and some helper methods ...
283 $META->add_method("get_${modifier_type}_method_modifiers" => sub {
284 my ($self, $method_name) = @_;
285 #return () unless exists $self->$attr_reader->{$method_name};
286 my $mm = $self->$attr_reader->{$method_name};
290 $META->add_method("has_${modifier_type}_method_modifiers" => sub {
291 my ($self, $method_name) = @_;
293 # for now we assume that if it exists,..
294 # it has at least one modifier in it
295 (exists $self->$attr_reader->{$method_name}) ? 1 : 0;
298 $META->add_method("add_${modifier_type}_method_modifier" => sub {
299 my ($self, $method_name, $method) = @_;
301 $self->$attr_reader->{$method_name} = []
302 unless exists $self->$attr_reader->{$method_name};
304 my $modifiers = $self->$attr_reader->{$method_name};
307 # check to see that we aren't adding the
308 # same code twice. We err in favor of the
309 # first on here, this may not be as expected
310 foreach my $modifier (@{$modifiers}) {
311 return if $modifier == $method;
314 push @{$modifiers} => $method;
319 ## ------------------------------------------------------------------
320 ## override method mofidiers
322 $META->add_attribute('override_method_modifiers' => (
323 reader => 'get_override_method_modifiers_map',
324 default => sub { {} }
328 # these are a little different because there
329 # can only be one per name, whereas the other
330 # method modifiers can have multiples.
333 sub add_override_method_modifier {
334 my ($self, $method_name, $method) = @_;
335 (!$self->has_method($method_name))
336 || Moose->throw_error("Cannot add an override of method '$method_name' " .
337 "because there is a local version of '$method_name'");
338 $self->get_override_method_modifiers_map->{$method_name} = $method;
341 sub has_override_method_modifier {
342 my ($self, $method_name) = @_;
344 # for now we assume that if it exists,..
345 # it has at least one modifier in it
346 (exists $self->get_override_method_modifiers_map->{$method_name}) ? 1 : 0;
349 sub get_override_method_modifier {
350 my ($self, $method_name) = @_;
351 $self->get_override_method_modifiers_map->{$method_name};
354 ## general list accessor ...
356 sub get_method_modifier_list {
357 my ($self, $modifier_type) = @_;
358 my $accessor = "get_${modifier_type}_method_modifiers_map";
359 keys %{$self->$accessor};
362 sub reset_package_cache_flag { (shift)->{'_package_cache_flag'} = undef }
363 sub update_package_cache_flag {
365 $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name);
369 sub _meta_method_class { 'Moose::Meta::Method::Meta' }
371 ## ------------------------------------------------------------------
374 $META->add_attribute('roles' => (
375 reader => 'get_roles',
376 default => sub { [] }
380 my ($self, $role) = @_;
381 (blessed($role) && $role->isa('Moose::Meta::Role'))
382 || Moose->throw_error("Roles must be instances of Moose::Meta::Role");
383 push @{$self->get_roles} => $role;
384 $self->reset_package_cache_flag;
387 sub calculate_all_roles {
393 $_->calculate_all_roles
394 } @{ $self->get_roles });
398 my ($self, $role) = @_;
400 || Moose->throw_error("You must supply a role name to look for");
401 my $role_name = blessed $role ? $role->name : $role;
402 # if we are it,.. then return true
403 return 1 if $role_name eq $self->name;
404 # otherwise.. check our children
405 foreach my $role (@{$self->get_roles}) {
406 return 1 if $role->does_role($role_name);
411 sub find_method_by_name { (shift)->get_method(@_) }
413 ## ------------------------------------------------------------------
415 ## ------------------------------------------------------------------
418 my ($self, $other, %args) = @_;
421 || Moose->throw_error("You must pass in an blessed instance");
423 my $application_class;
424 if ($other->isa('Moose::Meta::Role')) {
425 $application_class = $self->application_to_role_class;
427 elsif ($other->isa('Moose::Meta::Class')) {
428 $application_class = $self->application_to_class_class;
431 $application_class = $self->application_to_instance_class;
434 Class::MOP::load_class($application_class);
435 return $application_class->new(%args)->apply($self, $other, \%args);
438 sub composition_class_roles { }
441 my ($class, @role_specs) = @_;
443 require Moose::Meta::Role::Composite;
445 my (@roles, %role_params);
446 while (@role_specs) {
447 my ($role, $params) = @{ splice @role_specs, 0, 1 };
451 : Class::MOP::class_of($role);
453 my $actual_role = $requested_role->_role_for_combination($params);
454 push @roles => $actual_role;
456 next unless defined $params;
457 $role_params{$actual_role->name} = $params;
460 my $c = Moose::Meta::Role::Composite->new(roles => \@roles);
461 return $c->apply_params(\%role_params);
464 sub _role_for_combination {
465 my ($self, $params) = @_;
470 my ( $role, $package_name, %options ) = @_;
472 $options{package} = $package_name;
474 (ref $options{attributes} eq 'HASH')
475 || confess "You must pass a HASH ref of attributes"
476 if exists $options{attributes};
478 (ref $options{methods} eq 'HASH')
479 || confess "You must pass a HASH ref of methods"
480 if exists $options{methods};
482 my (%initialize_options) = %options;
483 delete @initialize_options{qw(
492 my $meta = $role->initialize( $package_name => %initialize_options );
494 $meta->_instantiate_module( $options{version}, $options{authority} );
496 $meta->_add_meta_method if !$options{no_meta};
498 if (exists $options{attributes}) {
499 foreach my $attribute_name (keys %{$options{attributes}}) {
500 my $attr = $options{attributes}->{$attribute_name};
501 $meta->add_attribute(
502 $attribute_name => blessed $attr ? $attr : %{$attr} );
506 if (exists $options{methods}) {
507 foreach my $method_name (keys %{$options{methods}}) {
508 $meta->add_method($method_name, $options{methods}->{$method_name});
512 Class::MOP::weaken_metaclass($meta->name)
513 if $meta->is_anon_role;
521 for my $meta (Class::MOP::get_all_metaclass_instances) {
522 next if $meta->name eq $self->name;
523 next unless $meta->isa('Moose::Meta::Class')
524 || $meta->isa('Moose::Meta::Role');
525 push @consumers, $meta->name
526 if $meta->does_role($self->name);
531 # anonymous roles. most of it is copied straight out of Class::MOP::Class.
532 # an intrepid hacker might find great riches if he unifies this code with that
533 # code in Class::MOP::Module or Class::MOP::Package
536 # this should be sufficient, if you have a
537 # use case where it is not, write a test and
539 my $ANON_ROLE_SERIAL = 0;
542 # we need a sufficiently annoying prefix
543 # this should suffice for now, this is
544 # used in a couple of places below, so
545 # need to put it up here for now.
546 my $ANON_ROLE_PREFIX = 'Moose::Meta::Role::__ANON__::SERIAL::';
550 no warnings 'uninitialized';
551 $self->name =~ /^$ANON_ROLE_PREFIX/;
554 sub create_anon_role {
555 my ($role, %options) = @_;
556 my $package_name = $ANON_ROLE_PREFIX . ++$ANON_ROLE_SERIAL;
557 return $role->create($package_name, %options);
561 # this will only get called for
562 # anon-roles, all other calls
563 # are assumed to occur during
564 # global destruction and so don't
565 # really need to be handled explicitly
569 return if in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated
571 no warnings 'uninitialized';
572 return unless $self->name =~ /^$ANON_ROLE_PREFIX/;
574 # XXX: is this necessary for us? I don't understand what it's doing
577 # Moose does a weird thing where it replaces the metaclass for
578 # class when fixing metaclass incompatibility. In that case,
579 # we don't want to clean out the namespace now. We can detect
580 # that because Moose will explicitly update the singleton
581 # cache in Class::MOP.
582 #my $current_meta = Class::MOP::get_metaclass_by_name($self->name);
583 #return if $current_meta ne $self;
585 my ($serial_id) = ($self->name =~ /^$ANON_ROLE_PREFIX(\d+)/);
587 foreach my $key (keys %{$ANON_ROLE_PREFIX . $serial_id}) {
588 delete ${$ANON_ROLE_PREFIX . $serial_id}{$key};
590 delete ${'main::' . $ANON_ROLE_PREFIX}{$serial_id . '::'};
594 #####################################################################
596 ## This is Moose::Meta::Role as defined by Moose (plus the use of
597 ## MooseX::AttributeHelpers module). It is here as a reference to
598 ## make it easier to see what is happening above with all the meta
600 #####################################################################
603 # metaclass => 'Array',
604 # reader => 'get_roles',
605 # isa => 'ArrayRef[Moose::Meta::Role]',
606 # default => sub { [] },
608 # 'push' => 'add_role',
612 # has 'excluded_roles_map' => (
613 # metaclass => 'Hash',
614 # reader => 'get_excluded_roles_map',
615 # isa => 'HashRef[Str]',
617 # # Not exactly set, cause it sets multiple
618 # 'set' => 'add_excluded_roles',
619 # 'keys' => 'get_excluded_roles_list',
620 # 'exists' => 'excludes_role',
624 # has 'required_methods' => (
625 # metaclass => 'Hash',
626 # reader => 'get_required_methods_map',
627 # isa => 'HashRef[Moose::Meta::Role::Method::Required]',
629 # # not exactly set, or delete since it works for multiple
630 # 'set' => 'add_required_methods',
631 # 'delete' => 'remove_required_methods',
632 # 'keys' => 'get_required_method_list',
633 # 'exists' => 'requires_method',
637 # # the before, around and after modifiers are
638 # # HASH keyed by method-name, with ARRAY of
639 # # CODE refs to apply in that order
641 # has 'before_method_modifiers' => (
642 # metaclass => 'Hash',
643 # reader => 'get_before_method_modifiers_map',
644 # isa => 'HashRef[ArrayRef[CodeRef]]',
646 # 'keys' => 'get_before_method_modifiers',
647 # 'exists' => 'has_before_method_modifiers',
648 # # This actually makes sure there is an
649 # # ARRAY at the given key, and pushed onto
650 # # it. It also checks for duplicates as well
651 # # 'add' => 'add_before_method_modifier'
655 # has 'after_method_modifiers' => (
656 # metaclass => 'Hash',
657 # reader =>'get_after_method_modifiers_map',
658 # isa => 'HashRef[ArrayRef[CodeRef]]',
660 # 'keys' => 'get_after_method_modifiers',
661 # 'exists' => 'has_after_method_modifiers',
662 # # This actually makes sure there is an
663 # # ARRAY at the given key, and pushed onto
664 # # it. It also checks for duplicates as well
665 # # 'add' => 'add_after_method_modifier'
669 # has 'around_method_modifiers' => (
670 # metaclass => 'Hash',
671 # reader =>'get_around_method_modifiers_map',
672 # isa => 'HashRef[ArrayRef[CodeRef]]',
674 # 'keys' => 'get_around_method_modifiers',
675 # 'exists' => 'has_around_method_modifiers',
676 # # This actually makes sure there is an
677 # # ARRAY at the given key, and pushed onto
678 # # it. It also checks for duplicates as well
679 # # 'add' => 'add_around_method_modifier'
683 # # override is similar to the other modifiers
684 # # except that it is not an ARRAY of code refs
685 # # but instead just a single name->code mapping
687 # has 'override_method_modifiers' => (
688 # metaclass => 'Hash',
689 # reader =>'get_override_method_modifiers_map',
690 # isa => 'HashRef[CodeRef]',
692 # 'keys' => 'get_override_method_modifier',
693 # 'exists' => 'has_override_method_modifier',
694 # 'add' => 'add_override_method_modifier', # checks for local method ..
698 #####################################################################
709 Moose::Meta::Role - The Moose Role metaclass
713 This class is a subclass of L<Class::MOP::Module> that provides
714 additional Moose-specific functionality.
716 It's API looks a lot like L<Moose::Meta::Class>, but internally it
717 implements many things differently. This may change in the future.
721 C<Moose::Meta::Role> is a subclass of L<Class::MOP::Module>.
729 =item B<< Moose::Meta::Role->initialize($role_name) >>
731 This method creates a new role object with the provided name.
733 =item B<< Moose::Meta::Role->combine( [ $role => { ... } ], [ $role ], ... ) >>
735 This method accepts a list of array references. Each array reference
736 should contain a role name or L<Moose::Meta::Role> object as its first element. The second element is
737 an optional hash reference. The hash reference can contain C<-excludes>
738 and C<-alias> keys to control how methods are composed from the role.
740 The return value is a new L<Moose::Meta::Role::Composite> that
741 represents the combined roles.
743 =item B<< $metarole->composition_class_roles >>
745 When combining multiple roles using C<combine>, this method is used to obtain a
746 list of role names to be applied to the L<Moose::Meta::Role::Composite>
747 instance returned by C<combine>. The default implementation returns an empty
748 list. Extensions that need to hook into role combination may wrap this method
749 to return additional role names.
751 =item B<< Moose::Meta::Role->create($name, %options) >>
753 This method is identical to the L<Moose::Meta::Class> C<create>
756 =item B<< Moose::Meta::Role->create_anon_role >>
758 This method is identical to the L<Moose::Meta::Class>
759 C<create_anon_class> method.
761 =item B<< $metarole->is_anon_role >>
763 Returns true if the role is an anonymous role.
765 =item B<< $metarole->consumers >>
767 Returns a list of names of classes and roles which consume this role.
771 =head2 Role application
775 =item B<< $metarole->apply( $thing, @options ) >>
777 This method applies a role to the given C<$thing>. That can be another
778 L<Moose::Meta::Role>, object, a L<Moose::Meta::Class> object, or a
779 (non-meta) object instance.
781 The options are passed directly to the constructor for the appropriate
782 L<Moose::Meta::Role::Application> subclass.
784 Note that this will apply the role even if the C<$thing> in question already
785 C<does> this role. L<Moose::Util/does_role> is a convenient wrapper for
786 finding out if role application is necessary.
790 =head2 Roles and other roles
794 =item B<< $metarole->get_roles >>
796 This returns an array reference of roles which this role does. This
797 list may include duplicates.
799 =item B<< $metarole->calculate_all_roles >>
801 This returns a I<unique> list of all roles that this role does, and
802 all the roles that its roles do.
804 =item B<< $metarole->does_role($role) >>
806 Given a role I<name> or L<Moose::Meta::Role> object, returns true if this role
809 =item B<< $metarole->add_role($role) >>
811 Given a L<Moose::Meta::Role> object, this adds the role to the list of
812 roles that the role does.
814 =item B<< $metarole->get_excluded_roles_list >>
816 Returns a list of role names which this role excludes.
818 =item B<< $metarole->excludes_role($role_name) >>
820 Given a role I<name>, returns true if this role excludes the named
823 =item B<< $metarole->add_excluded_roles(@role_names) >>
825 Given one or more role names, adds those roles to the list of excluded
832 The methods for dealing with a role's methods are all identical in API
833 and behavior to the same methods in L<Class::MOP::Class>.
837 =item B<< $metarole->method_metaclass >>
839 Returns the method metaclass name for the role. This defaults to
840 L<Moose::Meta::Role::Method>.
842 =item B<< $metarole->get_method($name) >>
844 =item B<< $metarole->has_method($name) >>
846 =item B<< $metarole->add_method( $name, $body ) >>
848 =item B<< $metarole->get_method_list >>
850 =item B<< $metarole->find_method_by_name($name) >>
852 These methods are all identical to the methods of the same name in
853 L<Class::MOP::Package>
859 As with methods, the methods for dealing with a role's attribute are
860 all identical in API and behavior to the same methods in
861 L<Class::MOP::Class>.
863 However, attributes stored in this class are I<not> stored as
864 objects. Rather, the attribute definition is stored as a hash
865 reference. When a role is composed into a class, this hash reference
866 is passed directly to the metaclass's C<add_attribute> method.
868 This is quite likely to change in the future.
872 =item B<< $metarole->get_attribute($attribute_name) >>
874 =item B<< $metarole->has_attribute($attribute_name) >>
876 =item B<< $metarole->get_attribute_list >>
878 =item B<< $metarole->add_attribute($name, %options) >>
880 =item B<< $metarole->remove_attribute($attribute_name) >>
884 =head2 Required methods
888 =item B<< $metarole->get_required_method_list >>
890 Returns the list of methods required by the role.
892 =item B<< $metarole->requires_method($name) >>
894 Returns true if the role requires the named method.
896 =item B<< $metarole->add_required_methods(@names) >>
898 Adds the named methods to the role's list of required methods.
900 =item B<< $metarole->remove_required_methods(@names) >>
902 Removes the named methods from the role's list of required methods.
904 =item B<< $metarole->add_conflicting_method(%params) >>
906 Instantiate the parameters as a L<Moose::Meta::Role::Method::Conflicting>
907 object, then add it to the required method list.
911 =head2 Method modifiers
913 These methods act like their counterparts in L<Class::MOP::Class> and
914 L<Moose::Meta::Class>.
916 However, method modifiers are simply stored internally, and are not
917 applied until the role itself is applied to a class.
921 =item B<< $metarole->add_after_method_modifier($method_name, $method) >>
923 =item B<< $metarole->add_around_method_modifier($method_name, $method) >>
925 =item B<< $metarole->add_before_method_modifier($method_name, $method) >>
927 =item B<< $metarole->add_override_method_modifier($method_name, $method) >>
929 These methods all add an appropriate modifier to the internal list of
932 =item B<< $metarole->has_after_method_modifiers >>
934 =item B<< $metarole->has_around_method_modifiers >>
936 =item B<< $metarole->has_before_method_modifiers >>
938 =item B<< $metarole->has_override_method_modifier >>
940 Return true if the role has any modifiers of the given type.
942 =item B<< $metarole->get_after_method_modifiers($method_name) >>
944 =item B<< $metarole->get_around_method_modifiers($method_name) >>
946 =item B<< $metarole->get_before_method_modifiers($method_name) >>
948 Given a method name, returns a list of the appropriate modifiers for
951 =item B<< $metarole->get_override_method_modifier($method_name) >>
953 Given a method name, returns the override method modifier for that
954 method, if it has one.
962 =item B<< Moose::Meta::Role->meta >>
964 This will return a L<Class::MOP::Class> instance for this class.
970 See L<Moose/BUGS> for details on reporting bugs.
974 Stevan Little E<lt>stevan@iinteractive.comE<gt>
976 =head1 COPYRIGHT AND LICENSE
978 Copyright 2006-2010 by Infinity Interactive, Inc.
980 L<http://www.iinteractive.com>
982 This library is free software; you can redistribute it and/or modify
983 it under the same terms as Perl itself.