X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod.pm;h=0a8967923e72d7365099b6f4c4199a76800b577b;hb=db236a63c00371129c2254251aaa1408f044cd89;hp=8c902f01edee7800b92ba012b9a7e3252d178db3;hpb=8ee73eeb7e76858f1dbe56f69101a2dc1e096559;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method.pm b/lib/Moose/Meta/Method.pm index 8c902f0..0a89679 100644 --- a/lib/Moose/Meta/Method.pm +++ b/lib/Moose/Meta/Method.pm @@ -3,14 +3,69 @@ package Moose::Meta::Method; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '1.10'; +$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__ =pod -=cut \ No newline at end of file +=head1 NAME + +Moose::Meta::Method - A Moose Method metaclass + +=head1 DESCRIPTION + +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. + +=head1 INHERITANCE + +C is a subclass of L. + +=head1 BUGS + +See L for details on reporting bugs. + +=head1 AUTHOR + +Stevan Little Estevan@iinteractive.comE + +=head1 COPYRIGHT AND LICENSE + +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