Moose::Meta::Method - A Moose Method metaclass


Moose documentation Contained in the Moose distribution.

Index


Code Index:

NAME

Top

Moose::Meta::Method - A Moose Method metaclass

VERSION

Top

version 2.0010

DESCRIPTION

Top

This class is a subclass of Class::MOP::Method that provides additional Moose-specific functionality, all of which is private.

To understand this class, you should read the the Class::MOP::Method documentation.

INHERITANCE

Top

Moose::Meta::Method is a subclass of Class::MOP::Method.

BUGS

Top

See BUGS in Moose for details on reporting bugs.

AUTHOR

Top

Stevan Little <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Top


Moose documentation Contained in the Moose distribution.

package Moose::Meta::Method;
BEGIN {
  $Moose::Meta::Method::AUTHORITY = 'cpan:STEVAN';
}
BEGIN {
  $Moose::Meta::Method::VERSION = '2.0010';
}

use strict;
use warnings;

use Class::MOP::MiniTrait;

use base 'Class::MOP::Method';

Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');

sub _error_thrower {
    my $self = shift;
    ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class";
}

sub throw_error {
    my $self = shift;
    my $inv = $self->_error_thrower;
    unshift @_, "message" if @_ % 2 == 1;
    unshift @_, method => $self if ref $self;
    unshift @_, $inv;
    my $handler = $inv->can("throw_error");
    goto $handler; # to avoid incrementing depth by 1
}

sub _inline_throw_error {
    my ( $self, $msg, $args ) = @_;
    "\$meta->throw_error($msg" . ($args ? ", $args" : "") . ")"; # FIXME makes deparsing *REALLY* hard
}

1;

# ABSTRACT: A Moose Method metaclass




__END__