1 package Moose::Meta::Method;
6 use Class::MOP::MiniTrait;
8 use base 'Class::MOP::Method';
10 Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
14 require Moose::Meta::Class;
15 ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class";
20 my $inv = $self->_error_thrower;
21 unshift @_, "message" if @_ % 2 == 1;
22 unshift @_, method => $self if ref $self;
24 my $handler = $inv->can("throw_error");
25 goto $handler; # to avoid incrementing depth by 1
28 sub _inline_throw_error {
29 my ( $self, $msg, $args ) = @_;
31 my $inv = $self->_error_thrower;
33 $inv = 'Moose::Meta::Class' unless $inv->can('_inline_throw_error');
36 my $class = $self->associated_metaclass;
38 my $class_name = B::perlstring($class->name);
39 my $meth_name = B::perlstring($self->name);
40 $args = 'method => Class::MOP::class_of(' . $class_name . ')'
41 . '->find_method_by_name(' . $meth_name . '), '
42 . (defined $args ? $args : '');
45 return $inv->_inline_throw_error($msg, $args)
50 # ABSTRACT: A Moose Method metaclass
58 This class is a subclass of L<Class::MOP::Method> that provides
59 additional Moose-specific functionality, all of which is private.
61 To understand this class, you should read the the L<Class::MOP::Method>
66 C<Moose::Meta::Method> is a subclass of L<Class::MOP::Method>.
70 See L<Moose/BUGS> for details on reporting bugs.