X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod.pm;h=8f438d03c6f0d5af721bc25e263fdd3b1c6352de;hb=82b8ff57c307952b46200cec2606db318ad92e7f;hp=4907a70485d3edf2b5c823b30024938da123df6e;hpb=39b3bc94309529721acb365c64b2ff52a0c2be35;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method.pm b/lib/Moose/Meta/Method.pm index 4907a70..8f438d0 100644 --- a/lib/Moose/Meta/Method.pm +++ b/lib/Moose/Meta/Method.pm @@ -3,10 +3,32 @@ package Moose::Meta::Method; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '1.11'; +$VERSION = eval $VERSION; +our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Method'; +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; __END__ @@ -15,35 +37,35 @@ __END__ =head1 NAME -=head1 SYNOPOSIS +Moose::Meta::Method - A Moose Method metaclass =head1 DESCRIPTION -=head1 METHODS +This class is a subclass of L that provides +additional Moose-specific functionality, all of which is private. + +To understand this class, you should read the the L +documentation. -=over 4 +=head1 INHERITANCE -=back +C is a subclass of L. =head1 BUGS -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. +See L for details on reporting bugs. =head1 AUTHOR Stevan Little Estevan@iinteractive.comE -Yuval Kogman Enothingmuch@woobling.comE - =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006-2010 by Infinity Interactive, Inc. L This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -=cut \ No newline at end of file +=cut