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 add => 'add_required_methods',
69 remove => 'remove_required_methods',
70 get_list => 'get_required_method_list',
71 existence => 'requires_method',
75 name => 'attribute_map',
76 attr_reader => 'get_attribute_map',
78 get => 'get_attribute',
79 get_list => 'get_attribute_list',
80 existence => 'has_attribute',
81 remove => 'remove_attribute',
86 my $attr_reader = $action->{attr_reader};
87 my $methods = $action->{methods};
89 # create the attribute
90 $META->add_attribute($action->{name} => (
91 reader => $attr_reader,
95 # create some helper methods
96 $META->add_method($methods->{add} => sub {
97 my ($self, @values) = @_;
98 $self->$attr_reader->{$_} = undef foreach @values;
99 }) if exists $methods->{add};
101 $META->add_method($methods->{get_list} => sub {
103 keys %{$self->$attr_reader};
104 }) if exists $methods->{get_list};
106 $META->add_method($methods->{get} => sub {
107 my ($self, $name) = @_;
108 $self->$attr_reader->{$name}
109 }) if exists $methods->{get};
111 $META->add_method($methods->{existence} => sub {
112 my ($self, $name) = @_;
113 exists $self->$attr_reader->{$name} ? 1 : 0;
114 }) if exists $methods->{existence};
116 $META->add_method($methods->{remove} => sub {
117 my ($self, @values) = @_;
118 delete $self->$attr_reader->{$_} foreach @values;
119 }) if exists $methods->{remove};
122 $META->add_attribute(
124 reader => 'method_metaclass',
125 default => 'Moose::Meta::Role::Method',
128 ## some things don't always fit, so they go here ...
133 unless ( defined $name && $name ) {
135 Moose->throw_error("You must provide a name for the attribute");
138 if (scalar @_ == 1 && ref($_[0]) eq 'HASH') {
144 $self->get_attribute_map->{$name} = $attr_desc;
147 ## ------------------------------------------------------------------
151 # the before/around/after method modifiers are
152 # stored by name, but there can be many methods
153 # then associated with that name. So again we have
154 # lots of similar functionality, so we can do some
155 # meta-programmin' and save some time.
158 foreach my $modifier_type (qw[ before around after ]) {
160 my $attr_reader = "get_${modifier_type}_method_modifiers_map";
162 # create the attribute ...
163 $META->add_attribute("${modifier_type}_method_modifiers" => (
164 reader => $attr_reader,
165 default => sub { {} }
168 # and some helper methods ...
169 $META->add_method("get_${modifier_type}_method_modifiers" => sub {
170 my ($self, $method_name) = @_;
171 #return () unless exists $self->$attr_reader->{$method_name};
172 @{$self->$attr_reader->{$method_name}};
175 $META->add_method("has_${modifier_type}_method_modifiers" => sub {
176 my ($self, $method_name) = @_;
178 # for now we assume that if it exists,..
179 # it has at least one modifier in it
180 (exists $self->$attr_reader->{$method_name}) ? 1 : 0;
183 $META->add_method("add_${modifier_type}_method_modifier" => sub {
184 my ($self, $method_name, $method) = @_;
186 $self->$attr_reader->{$method_name} = []
187 unless exists $self->$attr_reader->{$method_name};
189 my $modifiers = $self->$attr_reader->{$method_name};
192 # check to see that we aren't adding the
193 # same code twice. We err in favor of the
194 # first on here, this may not be as expected
195 foreach my $modifier (@{$modifiers}) {
196 return if $modifier == $method;
199 push @{$modifiers} => $method;
204 ## ------------------------------------------------------------------
205 ## override method mofidiers
207 $META->add_attribute('override_method_modifiers' => (
208 reader => 'get_override_method_modifiers_map',
209 default => sub { {} }
213 # these are a little different because there
214 # can only be one per name, whereas the other
215 # method modifiers can have multiples.
218 sub add_override_method_modifier {
219 my ($self, $method_name, $method) = @_;
220 (!$self->has_method($method_name))
221 || Moose->throw_error("Cannot add an override of method '$method_name' " .
222 "because there is a local version of '$method_name'");
223 $self->get_override_method_modifiers_map->{$method_name} = $method;
226 sub has_override_method_modifier {
227 my ($self, $method_name) = @_;
229 # for now we assume that if it exists,..
230 # it has at least one modifier in it
231 (exists $self->get_override_method_modifiers_map->{$method_name}) ? 1 : 0;
234 sub get_override_method_modifier {
235 my ($self, $method_name) = @_;
236 $self->get_override_method_modifiers_map->{$method_name};
239 ## general list accessor ...
241 sub get_method_modifier_list {
242 my ($self, $modifier_type) = @_;
243 my $accessor = "get_${modifier_type}_method_modifiers_map";
244 keys %{$self->$accessor};
247 sub reset_package_cache_flag { (shift)->{'_package_cache_flag'} = undef }
248 sub update_package_cache_flag {
250 $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name);
255 ## ------------------------------------------------------------------
258 $META->add_attribute('roles' => (
259 reader => 'get_roles',
260 default => sub { [] }
264 my ($self, $role) = @_;
265 (blessed($role) && $role->isa('Moose::Meta::Role'))
266 || Moose->throw_error("Roles must be instances of Moose::Meta::Role");
267 push @{$self->get_roles} => $role;
268 $self->reset_package_cache_flag;
271 sub calculate_all_roles {
277 $_->calculate_all_roles
278 } @{ $self->get_roles });
282 my ($self, $role_name) = @_;
284 || Moose->throw_error("You must supply a role name to look for");
285 # if we are it,.. then return true
286 return 1 if $role_name eq $self->name;
287 # otherwise.. check our children
288 foreach my $role (@{$self->get_roles}) {
289 return 1 if $role->does_role($role_name);
294 ## ------------------------------------------------------------------
300 my $current = Class::MOP::check_package_cache_flag($self->name);
302 if (defined $self->{'_package_cache_flag'} && $self->{'_package_cache_flag'} == $current) {
303 return $self->{'methods'} ||= {};
306 $self->{_package_cache_flag} = $current;
308 my $map = $self->{'methods'} ||= {};
310 my $role_name = $self->name;
311 my $method_metaclass = $self->method_metaclass;
313 my $all_code = $self->get_all_package_symbols('CODE');
315 foreach my $symbol (keys %{ $all_code }) {
316 my $code = $all_code->{$symbol};
318 next if exists $map->{$symbol} &&
319 defined $map->{$symbol} &&
320 $map->{$symbol}->body == $code;
322 my ($pkg, $name) = Class::MOP::get_code_info($code);
323 my $meta = Class::MOP::class_of($pkg);
325 if ($meta && $meta->isa('Moose::Meta::Role')) {
326 my $role = $meta->name;
327 next unless $self->does_role($role);
331 # in 5.10 constant.pm the constants show up
332 # as being in the right package, but in pre-5.10
333 # they show up as constant::__ANON__ so we
334 # make an exception here to be sure that things
335 # work as expected in both.
337 unless ($pkg eq 'constant' && $name eq '__ANON__') {
338 next if ($pkg || '') ne $role_name ||
339 (($name || '') ne '__ANON__' && ($pkg || '') ne $role_name);
343 $map->{$symbol} = $method_metaclass->wrap(
345 package_name => $role_name,
354 my ($self, $name) = @_;
355 $self->get_method_map->{$name};
359 my ($self, $name) = @_;
360 exists $self->get_method_map->{$name} ? 1 : 0
363 # FIXME this is copy-pasted from Class::MOP::Class
364 # refactor to inherit from some common base
365 sub wrap_method_body {
366 my ( $self, %args ) = @_;
368 ('CODE' eq ref $args{body})
369 || Moose->throw_error("Your code block must be a CODE reference");
371 $self->method_metaclass->wrap(
372 package_name => $self->name,
378 my ($self, $method_name, $method) = @_;
379 (defined $method_name && $method_name)
380 || Moose->throw_error("You must define a method name");
383 if (blessed($method)) {
384 $body = $method->body;
385 if ($method->package_name ne $self->name) {
386 $method = $method->clone(
387 package_name => $self->name,
389 ) if $method->can('clone');
394 $method = $self->wrap_method_body( body => $body, name => $method_name );
397 $method->attach_to_class($self);
399 $self->get_method_map->{$method_name} = $method;
401 my $full_method_name = ($self->name . '::' . $method_name);
402 $self->add_package_symbol(
403 { sigil => '&', type => 'CODE', name => $method_name },
404 subname($full_method_name => $body)
407 $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
410 sub find_method_by_name { (shift)->get_method(@_) }
412 sub get_method_list {
414 grep { !/^meta$/ } keys %{$self->get_method_map};
418 Carp::cluck("The alias_method method is deprecated. Use add_method instead.\n");
422 $self->add_method(@_);
425 ## ------------------------------------------------------------------
427 ## ------------------------------------------------------------------
430 my ($self, $other, @args) = @_;
433 || Moose->throw_error("You must pass in an blessed instance");
435 if ($other->isa('Moose::Meta::Role')) {
436 require Moose::Meta::Role::Application::ToRole;
437 return Moose::Meta::Role::Application::ToRole->new(@args)->apply($self, $other);
439 elsif ($other->isa('Moose::Meta::Class')) {
440 require Moose::Meta::Role::Application::ToClass;
441 return Moose::Meta::Role::Application::ToClass->new(@args)->apply($self, $other);
444 require Moose::Meta::Role::Application::ToInstance;
445 return Moose::Meta::Role::Application::ToInstance->new(@args)->apply($self, $other);
450 my ($class, @role_specs) = @_;
452 require Moose::Meta::Role::Application::RoleSummation;
453 require Moose::Meta::Role::Composite;
455 my (@roles, %role_params);
456 while (@role_specs) {
457 my ($role_name, $params) = @{ splice @role_specs, 0, 1 };
458 my $requested_role = Class::MOP::class_of($role_name);
460 my $actual_role = $requested_role->_role_for_combination($params);
461 push @roles => $actual_role;
463 next unless defined $params;
464 $role_params{$actual_role->name} = $params;
467 my $c = Moose::Meta::Role::Composite->new(roles => \@roles);
468 Moose::Meta::Role::Application::RoleSummation->new(
469 role_params => \%role_params
475 sub _role_for_combination {
476 my ($self, $params) = @_;
481 my ( $role, $package_name, %options ) = @_;
483 $options{package} = $package_name;
485 (ref $options{attributes} eq 'HASH')
486 || confess "You must pass a HASH ref of attributes"
487 if exists $options{attributes};
489 (ref $options{methods} eq 'HASH')
490 || confess "You must pass a HASH ref of methods"
491 if exists $options{methods};
493 my (%initialize_options) = %options;
494 delete @initialize_options{qw(
502 my $meta = $role->initialize( $package_name => %initialize_options );
504 $meta->_instantiate_module( $options{version}, $options{authority} );
507 $meta->add_method('meta' => sub {
508 $role->initialize(ref($_[0]) || $_[0]);
511 if (exists $options{attributes}) {
512 foreach my $attribute_name (keys %{$options{attributes}}) {
513 my $attr = $options{attributes}->{$attribute_name};
514 $meta->add_attribute($attribute_name => $attr);
518 if (exists $options{methods}) {
519 foreach my $method_name (keys %{$options{methods}}) {
520 $meta->add_method($method_name, $options{methods}->{$method_name});
524 Class::MOP::weaken_metaclass($meta->name)
525 if $meta->is_anon_role;
530 # anonymous roles. most of it is copied straight out of Class::MOP::Class.
531 # an intrepid hacker might find great riches if he unifies this code with that
532 # code in Class::MOP::Module or Class::MOP::Package
535 # this should be sufficient, if you have a
536 # use case where it is not, write a test and
538 my $ANON_ROLE_SERIAL = 0;
541 # we need a sufficiently annoying prefix
542 # this should suffice for now, this is
543 # used in a couple of places below, so
544 # need to put it up here for now.
545 my $ANON_ROLE_PREFIX = 'Moose::Meta::Role::__ANON__::SERIAL::';
549 no warnings 'uninitialized';
550 $self->name =~ /^$ANON_ROLE_PREFIX/;
553 sub create_anon_role {
554 my ($role, %options) = @_;
555 my $package_name = $ANON_ROLE_PREFIX . ++$ANON_ROLE_SERIAL;
556 return $role->create($package_name, %options);
560 # this will only get called for
561 # anon-roles, all other calls
562 # are assumed to occur during
563 # global destruction and so don't
564 # really need to be handled explicitly
568 return if in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated
570 no warnings 'uninitialized';
571 return unless $self->name =~ /^$ANON_ROLE_PREFIX/;
573 # XXX: is this necessary for us? I don't understand what it's doing
576 # Moose does a weird thing where it replaces the metaclass for
577 # class when fixing metaclass incompatibility. In that case,
578 # we don't want to clean out the namespace now. We can detect
579 # that because Moose will explicitly update the singleton
580 # cache in Class::MOP.
581 #my $current_meta = Class::MOP::get_metaclass_by_name($self->name);
582 #return if $current_meta ne $self;
584 my ($serial_id) = ($self->name =~ /^$ANON_ROLE_PREFIX(\d+)/);
586 foreach my $key (keys %{$ANON_ROLE_PREFIX . $serial_id}) {
587 delete ${$ANON_ROLE_PREFIX . $serial_id}{$key};
589 delete ${'main::' . $ANON_ROLE_PREFIX}{$serial_id . '::'};
593 #####################################################################
595 ## This is Moose::Meta::Role as defined by Moose (plus the use of
596 ## MooseX::AttributeHelpers module). It is here as a reference to
597 ## make it easier to see what is happening above with all the meta
599 #####################################################################
602 # metaclass => 'Collection::Array',
603 # reader => 'get_roles',
604 # isa => 'ArrayRef[Moose::Meta::Roles]',
605 # default => sub { [] },
607 # 'push' => 'add_role',
611 # has 'excluded_roles_map' => (
612 # metaclass => 'Collection::Hash',
613 # reader => 'get_excluded_roles_map',
614 # isa => 'HashRef[Str]',
616 # # Not exactly set, cause it sets multiple
617 # 'set' => 'add_excluded_roles',
618 # 'keys' => 'get_excluded_roles_list',
619 # 'exists' => 'excludes_role',
623 # has 'attribute_map' => (
624 # metaclass => 'Collection::Hash',
625 # reader => 'get_attribute_map',
626 # isa => 'HashRef[Str]',
628 # # 'set' => 'add_attribute' # has some special crap in it
629 # 'get' => 'get_attribute',
630 # 'keys' => 'get_attribute_list',
631 # 'exists' => 'has_attribute',
632 # # Not exactly delete, cause it sets multiple
633 # 'delete' => 'remove_attribute',
637 # has 'required_methods' => (
638 # metaclass => 'Collection::Hash',
639 # reader => 'get_required_methods_map',
640 # isa => 'HashRef[Str]',
642 # # not exactly set, or delete since it works for multiple
643 # 'set' => 'add_required_methods',
644 # 'delete' => 'remove_required_methods',
645 # 'keys' => 'get_required_method_list',
646 # 'exists' => 'requires_method',
650 # # the before, around and after modifiers are
651 # # HASH keyed by method-name, with ARRAY of
652 # # CODE refs to apply in that order
654 # has 'before_method_modifiers' => (
655 # metaclass => 'Collection::Hash',
656 # reader => 'get_before_method_modifiers_map',
657 # isa => 'HashRef[ArrayRef[CodeRef]]',
659 # 'keys' => 'get_before_method_modifiers',
660 # 'exists' => 'has_before_method_modifiers',
661 # # This actually makes sure there is an
662 # # ARRAY at the given key, and pushed onto
663 # # it. It also checks for duplicates as well
664 # # 'add' => 'add_before_method_modifier'
668 # has 'after_method_modifiers' => (
669 # metaclass => 'Collection::Hash',
670 # reader =>'get_after_method_modifiers_map',
671 # isa => 'HashRef[ArrayRef[CodeRef]]',
673 # 'keys' => 'get_after_method_modifiers',
674 # 'exists' => 'has_after_method_modifiers',
675 # # This actually makes sure there is an
676 # # ARRAY at the given key, and pushed onto
677 # # it. It also checks for duplicates as well
678 # # 'add' => 'add_after_method_modifier'
682 # has 'around_method_modifiers' => (
683 # metaclass => 'Collection::Hash',
684 # reader =>'get_around_method_modifiers_map',
685 # isa => 'HashRef[ArrayRef[CodeRef]]',
687 # 'keys' => 'get_around_method_modifiers',
688 # 'exists' => 'has_around_method_modifiers',
689 # # This actually makes sure there is an
690 # # ARRAY at the given key, and pushed onto
691 # # it. It also checks for duplicates as well
692 # # 'add' => 'add_around_method_modifier'
696 # # override is similar to the other modifiers
697 # # except that it is not an ARRAY of code refs
698 # # but instead just a single name->code mapping
700 # has 'override_method_modifiers' => (
701 # metaclass => 'Collection::Hash',
702 # reader =>'get_override_method_modifiers_map',
703 # isa => 'HashRef[CodeRef]',
705 # 'keys' => 'get_override_method_modifier',
706 # 'exists' => 'has_override_method_modifier',
707 # 'add' => 'add_override_method_modifier', # checks for local method ..
711 #####################################################################
722 Moose::Meta::Role - The Moose Role metaclass
726 This class is a subclass of L<Class::MOP::Module> that provides
727 additional Moose-specific functionality.
729 It's API looks a lot like L<Moose::Meta::Class>, but internally it
730 implements many things differently. This may change in the future.
734 C<Moose::Meta::Role> is a subclass of L<Class::MOP::Module>.
742 =item B<< Moose::Meta::Role->initialize($role_name) >>
744 This method creates a new role object with the provided name.
746 =item B<< Moose::Meta::Role->combine( [ $role => { ... } ], [ $role ], ... ) >>
748 This method accepts a list of array references. Each array reference
749 should contain a role name as its first element. The second element is
750 an optional hash reference. The hash reference can contain C<exclude>
751 and C<alias> keys to control how methods are composed from the role.
753 The return value is a new L<Moose::Meta::Role::Composite> that
754 represents the combined roles.
756 =item B<< Moose::Meta::Role->create($name, %options) >>
758 This method is identical to the L<Moose::Meta::Class> C<create>
761 =item B<< Moose::Meta::Role->create_anon_role >>
763 This method is identical to the L<Moose::Meta::Class>
764 C<create_anon_class> method.
766 =item B<< $metarole->is_anon_role >>
768 Returns true if the role is an anonymous role.
772 =head2 Role application
776 =item B<< $metarole->apply( $thing, @options ) >>
778 This method applies a role to the given C<$thing>. That can be another
779 L<Moose::Meta::Role>, object, a L<Moose::Meta::Class> object, or a
780 (non-meta) object instance.
782 The options are passed directly to the constructor for the appropriate
783 L<Moose::Meta::Role::Application> subclass.
785 Note that this will apply the role even if the C<$thing> in question already
786 C<does> this role. L<Moose::Util/does_role> is a convenient wrapper for
787 finding out if role application is necessary.
791 =head2 Roles and other roles
795 =item B<< $metarole->get_roles >>
797 This returns an array reference of roles which this role does. This
798 list may include duplicates.
800 =item B<< $metarole->calculate_all_roles >>
802 This returns a I<unique> list of all roles that this role does, and
803 all the roles that its roles do.
805 =item B<< $metarole->does_role($role_name) >>
807 Given a role I<name>, returns true if this role does the given
810 =item B<< $metarole->add_role($role) >>
812 Given a L<Moose::Meta::Role> object, this adds the role to the list of
813 roles that the role does.
815 =item B<< $metarole->get_excluded_roles_list >>
817 Returns a list of role names which this role excludes.
819 =item B<< $metarole->excludes_role($role_name) >>
821 Given a role I<name>, returns true if this role excludes the named
824 =item B<< $metarole->add_excluded_roles(@role_names) >>
826 Given one or more role names, adds those roles to the list of excluded
833 The methods for dealing with a role's methods are all identical in API
834 and behavior to the same methods in L<Class::MOP::Class>.
838 =item B<< $metarole->method_metaclass >>
840 Returns the method metaclass name for the role. This defaults to
841 L<Moose::Meta::Role::Method>.
843 =item B<< $metarole->get_method($name) >>
845 =item B<< $metarole->has_method($name) >>
847 =item B<< $metarole->add_method( $name, $body ) >>
849 =item B<< $metarole->get_method_list >>
851 =item B<< $metarole->get_method_map >>
853 =item B<< $metarole->find_method_by_name($name) >>
855 These methods are all identical to the methods of the same name in
862 As with methods, the methods for dealing with a role's attribute are
863 all identical in API and behavior to the same methods in
864 L<Class::MOP::Class>.
866 However, attributes stored in this class are I<not> stored as
867 objects. Rather, the attribute definition is stored as a hash
868 reference. When a role is composed into a class, this hash reference
869 is passed directly to the metaclass's C<add_attribute> method.
871 This is quite likely to change in the future.
875 =item B<< $metarole->get_attribute($attribute_name) >>
877 =item B<< $metarole->has_attribute($attribute_name) >>
879 =item B<< $metarole->get_attribute_map >>
881 =item B<< $metarole->get_attribute_list >>
883 =item B<< $metarole->add_attribute($name, %options) >>
885 =item B<< $metarole->remove_attribute($attribute_name) >>
889 =head2 Required methods
893 =item B<< $metarole->get_required_method_list >>
895 Returns the list of methods required by the role.
897 =item B<< $metarole->requires_method($name) >>
899 Returns true if the role requires the named method.
901 =item B<< $metarole->add_required_methods(@names) >>
903 Adds the named methods to the roles list of required methods.
905 =item B<< $metarole->remove_required_methods(@names) >>
907 Removes the named methods to the roles list of required methods.
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 All complex software has bugs lurking in it, and this module is no
971 exception. If you find a bug please either email me, or add the bug
976 Stevan Little E<lt>stevan@iinteractive.comE<gt>
978 =head1 COPYRIGHT AND LICENSE
980 Copyright 2006-2009 by Infinity Interactive, Inc.
982 L<http://www.iinteractive.com>
984 This library is free software; you can redistribute it and/or modify
985 it under the same terms as Perl itself.