X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod.pm;h=1488c3215e2f20729525337585c6a86755d37318;hb=d5f6cadef8d83deaf7dd95302908cd4f61aeab8a;hp=a3603fcd50b5221799e74a98aec110310c68dea0;hpb=93cc8330c689c1eb92171550e5fabb628a8759a6;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method.pm b/lib/Moose/Meta/Method.pm index a3603fc..1488c32 100644 --- a/lib/Moose/Meta/Method.pm +++ b/lib/Moose/Meta/Method.pm @@ -3,44 +3,54 @@ package Moose::Meta::Method; use strict; use warnings; -our $VERSION = '0.54'; -our $AUTHORITY = 'cpan:STEVAN'; +use Class::MOP::MiniTrait; use base 'Class::MOP::Method'; -1; +Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait'); -__END__ +sub _error_thrower { + my $self = shift; + ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class"; +} -=pod +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 +} -=head1 NAME +sub _inline_throw_error { + my ( $self, $msg, $args ) = @_; + "\$meta->throw_error($msg" . ($args ? ", $args" : "") . ")"; # FIXME makes deparsing *REALLY* hard +} -Moose::Meta::Method - A Moose Method metaclass +1; -=head1 DESCRIPTION +# ABSTRACT: A Moose Method metaclass -For now, this is nothing but a subclass of Class::MOP::Method, -but with the expanding role of the method sub-protocol, it might -be more useful later on. +__END__ -=head1 BUGS +=pod -All complex software has bugs lurking in it, and this module is no -exception. If you find a bug please either email me, or add the bug -to cpan-RT. +=head1 DESCRIPTION -=head1 AUTHOR +This class is a subclass of L that provides +additional Moose-specific functionality, all of which is private. -Stevan Little Estevan@iinteractive.comE +To understand this class, you should read the the L +documentation. -=head1 COPYRIGHT AND LICENSE +=head1 INHERITANCE -Copyright 2006-2008 by Infinity Interactive, Inc. +C is a subclass of L. -L +=head1 BUGS -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. +See L for details on reporting bugs. =cut