use Moose::Meta::Class::Immutable::Trait;
use Moose::Meta::Method::Constructor;
use Moose::Meta::Method::Destructor;
+use Moose::Meta::Method::Meta;
use Moose::Util;
use Class::MOP::MiniTrait;
return $new_class;
}
+sub _meta_method_class { 'Moose::Meta::Method::Meta' }
+
sub _anon_cache_key {
# Makes something like Super::Class|Super::Class::2=Role|Role::1
return join '=' => (
--- /dev/null
+
+package Moose::Meta::Method::Meta;
+
+use strict;
+use warnings;
+
+our $VERSION = '1.14';
+$VERSION = eval $VERSION;
+our $AUTHORITY = 'cpan:STEVAN';
+
+use base 'Moose::Meta::Method',
+ 'Class::MOP::Method::Meta';
+
+sub _is_caller_mop_internal {
+ my $self = shift;
+ my ($caller) = @_;
+ return 1 if $caller =~ /^Moose(?:::|$)/;
+ return $self->SUPER::_is_caller_mop_internal($caller);
+}
+
+# XXX: ugh multiple inheritance
+sub wrap {
+ my $class = shift;
+ return $class->Class::MOP::Method::Meta::wrap(@_);
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Moose::Meta::Method::Meta - A Moose Method metaclass for C<meta> methods
+
+=head1 DESCRIPTION
+
+This class is a subclass of L<Class::MOP::Method::Meta> that
+provides additional Moose-specific functionality, all of which is
+private.
+
+To understand this class, you should read the the
+L<Class::MOP::Method::Meta> documentation.
+
+=head1 BUGS
+
+See L<Moose/BUGS> for details on reporting bugs.
+
+=head1 AUTHOR
+
+Jesse Luehrs E<lt>doy at tozt dot net<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2006-2010 by Infinity Interactive, Inc.
+
+L<http://www.iinteractive.com>
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
use Moose::Meta::Role::Method;
use Moose::Meta::Role::Method::Required;
use Moose::Meta::Role::Method::Conflicting;
+use Moose::Meta::Method::Meta;
use Moose::Util qw( ensure_all_roles );
use Class::MOP::MiniTrait;
}
+sub _meta_method_class { 'Moose::Meta::Method::Meta' }
## ------------------------------------------------------------------
## subroles
package
attributes
methods
+ no_meta
version
authority
)};
$meta->_instantiate_module( $options{version}, $options{authority} );
- # FIXME totally lame
- $meta->add_method('meta' => sub {
- $role->initialize(ref($_[0]) || $_[0]);
- });
+ $meta->_add_meta_method if !$options{no_meta};
if (exists $options{attributes}) {
foreach my $attribute_name (keys %{$options{attributes}}) {