2 package Moose::Meta::Role;
8 use Scalar::Util 'blessed';
10 use Sub::Name 'subname';
11 use Devel::GlobalDestruction 'in_global_destruction';
13 our $VERSION = '0.79';
14 $VERSION = eval $VERSION;
15 our $AUTHORITY = 'cpan:STEVAN';
17 use Moose::Meta::Class;
18 use Moose::Meta::Role::Method;
19 use Moose::Meta::Role::Method::Required;
21 use base 'Class::MOP::Module';
23 ## ------------------------------------------------------------------
25 ## I normally don't do this, but I am doing
26 ## a whole bunch of meta-programmin in this
27 ## module, so it just makes sense. For a clearer
28 ## picture of what is going on in the next
29 ## several lines of code, look at the really
30 ## big comment at the end of this file (right
33 ## ------------------------------------------------------------------
35 my $META = __PACKAGE__->meta;
37 ## ------------------------------------------------------------------
41 # since roles are lazy, we hold all the attributes
42 # of the individual role in 'statis' until which
43 # time when it is applied to a class. This means
44 # keeping a lot of things in hash maps, so we are
45 # using a little of that meta-programmin' magic
46 # here an saving lots of extra typin. And since
47 # many of these attributes above require similar
48 # functionality to support them, so we again use
49 # the wonders of meta-programmin' to deliver a
50 # very compact solution to this normally verbose
56 name => 'excluded_roles_map',
57 attr_reader => 'get_excluded_roles_map' ,
59 add => 'add_excluded_roles',
60 get_list => 'get_excluded_roles_list',
61 existence => 'excludes_role',
65 name => 'required_methods',
66 attr_reader => 'get_required_methods_map',
68 remove => 'remove_required_methods',
69 get_list => 'get_required_method_list',
70 existence => 'requires_method',
74 name => 'attribute_map',
75 attr_reader => 'get_attribute_map',
77 get => 'get_attribute',
78 get_list => 'get_attribute_list',
79 existence => 'has_attribute',
80 remove => 'remove_attribute',
85 my $attr_reader = $action->{attr_reader};
86 my $methods = $action->{methods};
88 # create the attribute
89 $META->add_attribute($action->{name} => (
90 reader => $attr_reader,
94 # create some helper methods
95 $META->add_method($methods->{add} => sub {
96 my ($self, @values) = @_;
97 $self->$attr_reader->{$_} = undef foreach @values;
98 }) if exists $methods->{add};
100 $META->add_method($methods->{get_list} => sub {
102 keys %{$self->$attr_reader};
103 }) if exists $methods->{get_list};
105 $META->add_method($methods->{get} => sub {
106 my ($self, $name) = @_;
107 $self->$attr_reader->{$name}
108 }) if exists $methods->{get};
110 $META->add_method($methods->{existence} => sub {
111 my ($self, $name) = @_;
112 exists $self->$attr_reader->{$name} ? 1 : 0;
113 }) if exists $methods->{existence};
115 $META->add_method($methods->{remove} => sub {
116 my ($self, @values) = @_;
117 delete $self->$attr_reader->{$_} foreach @values;
118 }) if exists $methods->{remove};
121 $META->add_attribute(
123 reader => 'method_metaclass',
124 default => 'Moose::Meta::Role::Method',
127 $META->add_attribute(
128 'required_method_metaclass',
129 reader => 'required_method_metaclass',
130 default => 'Moose::Meta::Role::Method::Required',
133 ## some things don't always fit, so they go here ...
138 unless ( defined $name && $name ) {
140 Moose->throw_error("You must provide a name for the attribute");
143 if (scalar @_ == 1 && ref($_[0]) eq 'HASH') {
149 $self->get_attribute_map->{$name} = $attr_desc;
152 sub add_required_methods {
157 if (!blessed($method)) {
158 $method = $self->required_method_metaclass->new(
162 $self->get_required_methods_map->{$method->name} = $method;
166 ## ------------------------------------------------------------------
170 # the before/around/after method modifiers are
171 # stored by name, but there can be many methods
172 # then associated with that name. So again we have
173 # lots of similar functionality, so we can do some
174 # meta-programmin' and save some time.
177 foreach my $modifier_type (qw[ before around after ]) {
179 my $attr_reader = "get_${modifier_type}_method_modifiers_map";
181 # create the attribute ...
182 $META->add_attribute("${modifier_type}_method_modifiers" => (
183 reader => $attr_reader,
184 default => sub { {} }
187 # and some helper methods ...
188 $META->add_method("get_${modifier_type}_method_modifiers" => sub {
189 my ($self, $method_name) = @_;
190 #return () unless exists $self->$attr_reader->{$method_name};
191 @{$self->$attr_reader->{$method_name}};
194 $META->add_method("has_${modifier_type}_method_modifiers" => sub {
195 my ($self, $method_name) = @_;
197 # for now we assume that if it exists,..
198 # it has at least one modifier in it
199 (exists $self->$attr_reader->{$method_name}) ? 1 : 0;
202 $META->add_method("add_${modifier_type}_method_modifier" => sub {
203 my ($self, $method_name, $method) = @_;
205 $self->$attr_reader->{$method_name} = []
206 unless exists $self->$attr_reader->{$method_name};
208 my $modifiers = $self->$attr_reader->{$method_name};
211 # check to see that we aren't adding the
212 # same code twice. We err in favor of the
213 # first on here, this may not be as expected
214 foreach my $modifier (@{$modifiers}) {
215 return if $modifier == $method;
218 push @{$modifiers} => $method;
223 ## ------------------------------------------------------------------
224 ## override method mofidiers
226 $META->add_attribute('override_method_modifiers' => (
227 reader => 'get_override_method_modifiers_map',
228 default => sub { {} }
232 # these are a little different because there
233 # can only be one per name, whereas the other
234 # method modifiers can have multiples.
237 sub add_override_method_modifier {
238 my ($self, $method_name, $method) = @_;
239 (!$self->has_method($method_name))
240 || Moose->throw_error("Cannot add an override of method '$method_name' " .
241 "because there is a local version of '$method_name'");
242 $self->get_override_method_modifiers_map->{$method_name} = $method;
245 sub has_override_method_modifier {
246 my ($self, $method_name) = @_;
248 # for now we assume that if it exists,..
249 # it has at least one modifier in it
250 (exists $self->get_override_method_modifiers_map->{$method_name}) ? 1 : 0;
253 sub get_override_method_modifier {
254 my ($self, $method_name) = @_;
255 $self->get_override_method_modifiers_map->{$method_name};
258 ## general list accessor ...
260 sub get_method_modifier_list {
261 my ($self, $modifier_type) = @_;
262 my $accessor = "get_${modifier_type}_method_modifiers_map";
263 keys %{$self->$accessor};
266 sub reset_package_cache_flag { (shift)->{'_package_cache_flag'} = undef }
267 sub update_package_cache_flag {
269 $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name);
274 ## ------------------------------------------------------------------
277 $META->add_attribute('roles' => (
278 reader => 'get_roles',
279 default => sub { [] }
283 my ($self, $role) = @_;
284 (blessed($role) && $role->isa('Moose::Meta::Role'))
285 || Moose->throw_error("Roles must be instances of Moose::Meta::Role");
286 push @{$self->get_roles} => $role;
287 $self->reset_package_cache_flag;
290 sub calculate_all_roles {
296 $_->calculate_all_roles
297 } @{ $self->get_roles });
301 my ($self, $role_name) = @_;
303 || Moose->throw_error("You must supply a role name to look for");
304 # if we are it,.. then return true
305 return 1 if $role_name eq $self->name;
306 # otherwise.. check our children
307 foreach my $role (@{$self->get_roles}) {
308 return 1 if $role->does_role($role_name);
313 ## ------------------------------------------------------------------
319 my $current = Class::MOP::check_package_cache_flag($self->name);
321 if (defined $self->{'_package_cache_flag'} && $self->{'_package_cache_flag'} == $current) {
322 return $self->{'methods'} ||= {};
325 $self->{_package_cache_flag} = $current;
327 my $map = $self->{'methods'} ||= {};
329 my $role_name = $self->name;
330 my $method_metaclass = $self->method_metaclass;
332 my $all_code = $self->get_all_package_symbols('CODE');
334 foreach my $symbol (keys %{ $all_code }) {
335 my $code = $all_code->{$symbol};
337 next if exists $map->{$symbol} &&
338 defined $map->{$symbol} &&
339 $map->{$symbol}->body == $code;
341 my ($pkg, $name) = Class::MOP::get_code_info($code);
342 my $meta = Class::MOP::class_of($pkg);
344 if ($meta && $meta->isa('Moose::Meta::Role')) {
345 my $role = $meta->name;
346 next unless $self->does_role($role);
350 # in 5.10 constant.pm the constants show up
351 # as being in the right package, but in pre-5.10
352 # they show up as constant::__ANON__ so we
353 # make an exception here to be sure that things
354 # work as expected in both.
356 unless ($pkg eq 'constant' && $name eq '__ANON__') {
357 next if ($pkg || '') ne $role_name ||
358 (($name || '') ne '__ANON__' && ($pkg || '') ne $role_name);
362 $map->{$symbol} = $method_metaclass->wrap(
364 package_name => $role_name,
373 my ($self, $name) = @_;
374 $self->get_method_map->{$name};
378 my ($self, $name) = @_;
379 exists $self->get_method_map->{$name} ? 1 : 0
382 # FIXME this is copy-pasted from Class::MOP::Class
383 # refactor to inherit from some common base
384 sub wrap_method_body {
385 my ( $self, %args ) = @_;
387 ('CODE' eq ref $args{body})
388 || Moose->throw_error("Your code block must be a CODE reference");
390 $self->method_metaclass->wrap(
391 package_name => $self->name,
397 my ($self, $method_name, $method) = @_;
398 (defined $method_name && $method_name)
399 || Moose->throw_error("You must define a method name");
402 if (blessed($method)) {
403 $body = $method->body;
404 if ($method->package_name ne $self->name) {
405 $method = $method->clone(
406 package_name => $self->name,
408 ) if $method->can('clone');
413 $method = $self->wrap_method_body( body => $body, name => $method_name );
416 $method->attach_to_class($self);
418 $self->get_method_map->{$method_name} = $method;
420 my $full_method_name = ($self->name . '::' . $method_name);
421 $self->add_package_symbol(
422 { sigil => '&', type => 'CODE', name => $method_name },
423 subname($full_method_name => $body)
426 $self->update_package_cache_flag; # still valid, since we just added the method to the map, and if it was invalid before that then get_method_map updated it
429 sub find_method_by_name { (shift)->get_method(@_) }
431 sub get_method_list {
433 grep { !/^meta$/ } keys %{$self->get_method_map};
437 Carp::cluck("The alias_method method is deprecated. Use add_method instead.\n");
441 $self->add_method(@_);
444 ## ------------------------------------------------------------------
446 ## ------------------------------------------------------------------
449 my ($self, $other, @args) = @_;
452 || Moose->throw_error("You must pass in an blessed instance");
454 if ($other->isa('Moose::Meta::Role')) {
455 require Moose::Meta::Role::Application::ToRole;
456 return Moose::Meta::Role::Application::ToRole->new(@args)->apply($self, $other);
458 elsif ($other->isa('Moose::Meta::Class')) {
459 require Moose::Meta::Role::Application::ToClass;
460 return Moose::Meta::Role::Application::ToClass->new(@args)->apply($self, $other);
463 require Moose::Meta::Role::Application::ToInstance;
464 return Moose::Meta::Role::Application::ToInstance->new(@args)->apply($self, $other);
469 my ($class, @role_specs) = @_;
471 require Moose::Meta::Role::Application::RoleSummation;
472 require Moose::Meta::Role::Composite;
474 my (@roles, %role_params);
475 while (@role_specs) {
476 my ($role_name, $params) = @{ splice @role_specs, 0, 1 };
477 my $requested_role = Class::MOP::class_of($role_name);
479 my $actual_role = $requested_role->_role_for_combination($params);
480 push @roles => $actual_role;
482 next unless defined $params;
483 $role_params{$actual_role->name} = $params;
486 my $c = Moose::Meta::Role::Composite->new(roles => \@roles);
487 Moose::Meta::Role::Application::RoleSummation->new(
488 role_params => \%role_params
494 sub _role_for_combination {
495 my ($self, $params) = @_;
500 my ( $role, $package_name, %options ) = @_;
502 $options{package} = $package_name;
504 (ref $options{attributes} eq 'HASH')
505 || confess "You must pass a HASH ref of attributes"
506 if exists $options{attributes};
508 (ref $options{methods} eq 'HASH')
509 || confess "You must pass a HASH ref of methods"
510 if exists $options{methods};
512 my (%initialize_options) = %options;
513 delete @initialize_options{qw(
521 my $meta = $role->initialize( $package_name => %initialize_options );
523 $meta->_instantiate_module( $options{version}, $options{authority} );
526 $meta->add_method('meta' => sub {
527 $role->initialize(ref($_[0]) || $_[0]);
530 if (exists $options{attributes}) {
531 foreach my $attribute_name (keys %{$options{attributes}}) {
532 my $attr = $options{attributes}->{$attribute_name};
533 $meta->add_attribute($attribute_name => $attr);
537 if (exists $options{methods}) {
538 foreach my $method_name (keys %{$options{methods}}) {
539 $meta->add_method($method_name, $options{methods}->{$method_name});
543 Class::MOP::weaken_metaclass($meta->name)
544 if $meta->is_anon_role;
549 # anonymous roles. most of it is copied straight out of Class::MOP::Class.
550 # an intrepid hacker might find great riches if he unifies this code with that
551 # code in Class::MOP::Module or Class::MOP::Package
554 # this should be sufficient, if you have a
555 # use case where it is not, write a test and
557 my $ANON_ROLE_SERIAL = 0;
560 # we need a sufficiently annoying prefix
561 # this should suffice for now, this is
562 # used in a couple of places below, so
563 # need to put it up here for now.
564 my $ANON_ROLE_PREFIX = 'Moose::Meta::Role::__ANON__::SERIAL::';
568 no warnings 'uninitialized';
569 $self->name =~ /^$ANON_ROLE_PREFIX/;
572 sub create_anon_role {
573 my ($role, %options) = @_;
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 => 'Collection::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 => 'Collection::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 'attribute_map' => (
643 # metaclass => 'Collection::Hash',
644 # reader => 'get_attribute_map',
645 # isa => 'HashRef[Str]',
647 # # 'set' => 'add_attribute' # has some special crap in it
648 # 'get' => 'get_attribute',
649 # 'keys' => 'get_attribute_list',
650 # 'exists' => 'has_attribute',
651 # # Not exactly delete, cause it sets multiple
652 # 'delete' => 'remove_attribute',
656 # has 'required_methods' => (
657 # metaclass => 'Collection::Hash',
658 # reader => 'get_required_methods_map',
659 # isa => 'HashRef[Str]',
661 # # not exactly set, or delete since it works for multiple
662 # 'set' => 'add_required_methods',
663 # 'delete' => 'remove_required_methods',
664 # 'keys' => 'get_required_method_list',
665 # 'exists' => 'requires_method',
669 # # the before, around and after modifiers are
670 # # HASH keyed by method-name, with ARRAY of
671 # # CODE refs to apply in that order
673 # has 'before_method_modifiers' => (
674 # metaclass => 'Collection::Hash',
675 # reader => 'get_before_method_modifiers_map',
676 # isa => 'HashRef[ArrayRef[CodeRef]]',
678 # 'keys' => 'get_before_method_modifiers',
679 # 'exists' => 'has_before_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_before_method_modifier'
687 # has 'after_method_modifiers' => (
688 # metaclass => 'Collection::Hash',
689 # reader =>'get_after_method_modifiers_map',
690 # isa => 'HashRef[ArrayRef[CodeRef]]',
692 # 'keys' => 'get_after_method_modifiers',
693 # 'exists' => 'has_after_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_after_method_modifier'
701 # has 'around_method_modifiers' => (
702 # metaclass => 'Collection::Hash',
703 # reader =>'get_around_method_modifiers_map',
704 # isa => 'HashRef[ArrayRef[CodeRef]]',
706 # 'keys' => 'get_around_method_modifiers',
707 # 'exists' => 'has_around_method_modifiers',
708 # # This actually makes sure there is an
709 # # ARRAY at the given key, and pushed onto
710 # # it. It also checks for duplicates as well
711 # # 'add' => 'add_around_method_modifier'
715 # # override is similar to the other modifiers
716 # # except that it is not an ARRAY of code refs
717 # # but instead just a single name->code mapping
719 # has 'override_method_modifiers' => (
720 # metaclass => 'Collection::Hash',
721 # reader =>'get_override_method_modifiers_map',
722 # isa => 'HashRef[CodeRef]',
724 # 'keys' => 'get_override_method_modifier',
725 # 'exists' => 'has_override_method_modifier',
726 # 'add' => 'add_override_method_modifier', # checks for local method ..
730 #####################################################################
741 Moose::Meta::Role - The Moose Role metaclass
745 This class is a subclass of L<Class::MOP::Module> that provides
746 additional Moose-specific functionality.
748 It's API looks a lot like L<Moose::Meta::Class>, but internally it
749 implements many things differently. This may change in the future.
753 C<Moose::Meta::Role> is a subclass of L<Class::MOP::Module>.
761 =item B<< Moose::Meta::Role->initialize($role_name) >>
763 This method creates a new role object with the provided name.
765 =item B<< Moose::Meta::Role->combine( [ $role => { ... } ], [ $role ], ... ) >>
767 This method accepts a list of array references. Each array reference
768 should contain a role name as its first element. The second element is
769 an optional hash reference. The hash reference can contain C<exclude>
770 and C<alias> keys to control how methods are composed from the role.
772 The return value is a new L<Moose::Meta::Role::Composite> that
773 represents the combined roles.
775 =item B<< Moose::Meta::Role->create($name, %options) >>
777 This method is identical to the L<Moose::Meta::Class> C<create>
780 =item B<< Moose::Meta::Role->create_anon_role >>
782 This method is identical to the L<Moose::Meta::Class>
783 C<create_anon_class> method.
785 =item B<< $metarole->is_anon_role >>
787 Returns true if the role is an anonymous role.
791 =head2 Role application
795 =item B<< $metarole->apply( $thing, @options ) >>
797 This method applies a role to the given C<$thing>. That can be another
798 L<Moose::Meta::Role>, object, a L<Moose::Meta::Class> object, or a
799 (non-meta) object instance.
801 The options are passed directly to the constructor for the appropriate
802 L<Moose::Meta::Role::Application> subclass.
804 Note that this will apply the role even if the C<$thing> in question already
805 C<does> this role. L<Moose::Util/does_role> is a convenient wrapper for
806 finding out if role application is necessary.
810 =head2 Roles and other roles
814 =item B<< $metarole->get_roles >>
816 This returns an array reference of roles which this role does. This
817 list may include duplicates.
819 =item B<< $metarole->calculate_all_roles >>
821 This returns a I<unique> list of all roles that this role does, and
822 all the roles that its roles do.
824 =item B<< $metarole->does_role($role_name) >>
826 Given a role I<name>, returns true if this role does the given
829 =item B<< $metarole->add_role($role) >>
831 Given a L<Moose::Meta::Role> object, this adds the role to the list of
832 roles that the role does.
834 =item B<< $metarole->get_excluded_roles_list >>
836 Returns a list of role names which this role excludes.
838 =item B<< $metarole->excludes_role($role_name) >>
840 Given a role I<name>, returns true if this role excludes the named
843 =item B<< $metarole->add_excluded_roles(@role_names) >>
845 Given one or more role names, adds those roles to the list of excluded
852 The methods for dealing with a role's methods are all identical in API
853 and behavior to the same methods in L<Class::MOP::Class>.
857 =item B<< $metarole->method_metaclass >>
859 Returns the method metaclass name for the role. This defaults to
860 L<Moose::Meta::Role::Method>.
862 =item B<< $metarole->get_method($name) >>
864 =item B<< $metarole->has_method($name) >>
866 =item B<< $metarole->add_method( $name, $body ) >>
868 =item B<< $metarole->get_method_list >>
870 =item B<< $metarole->get_method_map >>
872 =item B<< $metarole->find_method_by_name($name) >>
874 These methods are all identical to the methods of the same name in
881 As with methods, the methods for dealing with a role's attribute are
882 all identical in API and behavior to the same methods in
883 L<Class::MOP::Class>.
885 However, attributes stored in this class are I<not> stored as
886 objects. Rather, the attribute definition is stored as a hash
887 reference. When a role is composed into a class, this hash reference
888 is passed directly to the metaclass's C<add_attribute> method.
890 This is quite likely to change in the future.
894 =item B<< $metarole->get_attribute($attribute_name) >>
896 =item B<< $metarole->has_attribute($attribute_name) >>
898 =item B<< $metarole->get_attribute_map >>
900 =item B<< $metarole->get_attribute_list >>
902 =item B<< $metarole->add_attribute($name, %options) >>
904 =item B<< $metarole->remove_attribute($attribute_name) >>
908 =head2 Required methods
912 =item B<< $metarole->get_required_method_list >>
914 Returns the list of methods required by the role.
916 =item B<< $metarole->requires_method($name) >>
918 Returns true if the role requires the named method.
920 =item B<< $metarole->add_required_methods(@names) >>
922 Adds the named methods to the role's list of required methods.
924 =item B<< $metarole->remove_required_methods(@names) >>
926 Removes the named methods to the role's list of required methods.
930 =head2 Method modifiers
932 These methods act like their counterparts in L<Class::Mop::Class> and
933 L<Moose::Meta::Class>.
935 However, method modifiers are simply stored internally, and are not
936 applied until the role itself is applied to a class.
940 =item B<< $metarole->add_after_method_modifier($method_name, $method) >>
942 =item B<< $metarole->add_around_method_modifier($method_name, $method) >>
944 =item B<< $metarole->add_before_method_modifier($method_name, $method) >>
946 =item B<< $metarole->add_override_method_modifier($method_name, $method) >>
948 These methods all add an appropriate modifier to the internal list of
951 =item B<< $metarole->has_after_method_modifiers >>
953 =item B<< $metarole->has_around_method_modifiers >>
955 =item B<< $metarole->has_before_method_modifiers >>
957 =item B<< $metarole->has_override_method_modifier >>
959 Return true if the role has any modifiers of the given type.
961 =item B<< $metarole->get_after_method_modifiers($method_name) >>
963 =item B<< $metarole->get_around_method_modifiers($method_name) >>
965 =item B<< $metarole->get_before_method_modifiers($method_name) >>
967 Given a method name, returns a list of the appropriate modifiers for
970 =item B<< $metarole->get_override_method_modifier($method_name) >>
972 Given a method name, returns the override method modifier for that
973 method, if it has one.
981 =item B<< Moose::Meta::Role->meta >>
983 This will return a L<Class::MOP::Class> instance for this class.
989 All complex software has bugs lurking in it, and this module is no
990 exception. If you find a bug please either email me, or add the bug
995 Stevan Little E<lt>stevan@iinteractive.comE<gt>
997 =head1 COPYRIGHT AND LICENSE
999 Copyright 2006-2009 by Infinity Interactive, Inc.
1001 L<http://www.iinteractive.com>
1003 This library is free software; you can redistribute it and/or modify
1004 it under the same terms as Perl itself.