Version 1.05
[gitmo/Moose.git] / lib / Moose / Meta / Method.pm
index 89135e6..7a89e68 100644 (file)
@@ -3,7 +3,7 @@ package Moose::Meta::Method;
 use strict;
 use warnings;
 
-our $VERSION   = '0.57';
+our $VERSION   = '1.05';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -11,8 +11,7 @@ use base 'Class::MOP::Method';
 
 sub _error_thrower {
     my $self = shift;
-    return "Moose::Meta::Class";
-    #( $self->associated_attribute || $self->associated_class ) # FIXME move to Accessor, fix for Constructor
+    ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class";
 }
 
 sub throw_error {
@@ -21,7 +20,8 @@ sub throw_error {
     unshift @_, "message" if @_ % 2 == 1;
     unshift @_, method => $self if ref $self;
     unshift @_, $inv;
-    goto $inv->can("throw_error"); # to avoid incrementing depth by 1
+    my $handler = $inv->can("throw_error");
+    goto $handler; # to avoid incrementing depth by 1
 }
 
 sub _inline_throw_error {
@@ -41,25 +41,19 @@ Moose::Meta::Method - A Moose Method metaclass
 
 =head1 DESCRIPTION
 
-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. 
+This class is a subclass of L<Class::MOP::Method> that provides
+additional Moose-specific functionality, all of which is private.
 
-=head1 METHODS
+To understand this class, you should read the the L<Class::MOP::Method>
+documentation.
 
-=over 4
+=head1 INHERITANCE
 
-=item throw_error $msg, %args
-
-=item _inline_throw_error $msg_expr, $args_expr
-
-=back
+C<Moose::Meta::Method> is a subclass of L<Class::MOP::Method>.
 
 =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<Moose/BUGS> for details on reporting bugs.
 
 =head1 AUTHOR
 
@@ -67,7 +61,7 @@ Stevan Little E<lt>stevan@iinteractive.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2008 by Infinity Interactive, Inc.
+Copyright 2006-2010 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>