1 package Moose::Meta::Method;
7 $VERSION = eval $VERSION;
8 our $AUTHORITY = 'cpan:STEVAN';
10 use base 'Class::MOP::Method';
14 return "Moose::Meta::Class";
15 #( $self->associated_attribute || $self->associated_class ) # FIXME move to Accessor, fix for Constructor
20 my $inv = $self->_error_thrower;
21 unshift @_, "message" if @_ % 2 == 1;
22 unshift @_, method => $self if ref $self;
24 my $handler = $inv->can("throw_error");
25 goto $handler; # to avoid incrementing depth by 1
28 sub _inline_throw_error {
29 my ( $self, $msg, $args ) = @_;
30 "\$meta->throw_error($msg" . ($args ? ", $args" : "") . ")"; # FIXME makes deparsing *REALLY* hard
41 Moose::Meta::Method - A Moose Method metaclass
45 For now, this is nothing but a subclass of Class::MOP::Method,
46 but with the expanding role of the method sub-protocol, it might
47 be more useful later on.
53 =item throw_error $msg, %args
55 =item _inline_throw_error $msg_expr, $args_expr
61 All complex software has bugs lurking in it, and this module is no
62 exception. If you find a bug please either email me, or add the bug
67 Stevan Little E<lt>stevan@iinteractive.comE<gt>
69 =head1 COPYRIGHT AND LICENSE
71 Copyright 2006-2008 by Infinity Interactive, Inc.
73 L<http://www.iinteractive.com>
75 This library is free software; you can redistribute it and/or modify
76 it under the same terms as Perl itself.