bump version to 0.65
[gitmo/Moose.git] / lib / Moose / Meta / Method.pm
CommitLineData
8ee73eeb 1package Moose::Meta::Method;
2
3use strict;
4use warnings;
5
30350cb4 6our $VERSION = '0.65';
e606ae5f 7$VERSION = eval $VERSION;
d44714be 8our $AUTHORITY = 'cpan:STEVAN';
8ee73eeb 9
10use base 'Class::MOP::Method';
11
3e504337 12sub _error_thrower {
13 my $self = shift;
18748ad6 14 ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class";
3e504337 15}
16
cee532a1 17sub throw_error {
18 my $self = shift;
3e504337 19 my $inv = $self->_error_thrower;
cee532a1 20 unshift @_, "message" if @_ % 2 == 1;
21 unshift @_, method => $self if ref $self;
22 unshift @_, $inv;
ffa3d7bf 23 my $handler = $inv->can("throw_error");
24 goto $handler; # to avoid incrementing depth by 1
cee532a1 25}
26
27sub _inline_throw_error {
28 my ( $self, $msg, $args ) = @_;
29 "\$meta->throw_error($msg" . ($args ? ", $args" : "") . ")"; # FIXME makes deparsing *REALLY* hard
30}
31
8ee73eeb 321;
33
34__END__
35
36=pod
37
39b3bc94 38=head1 NAME
39
ecb59493 40Moose::Meta::Method - A Moose Method metaclass
39b3bc94 41
42=head1 DESCRIPTION
43
ecb59493 44For now, this is nothing but a subclass of Class::MOP::Method,
45but with the expanding role of the method sub-protocol, it might
46be more useful later on.
39b3bc94 47
cee532a1 48=head1 METHODS
49
50=over 4
51
52=item throw_error $msg, %args
53
54=item _inline_throw_error $msg_expr, $args_expr
55
56=back
57
39b3bc94 58=head1 BUGS
59
60All complex software has bugs lurking in it, and this module is no
61exception. If you find a bug please either email me, or add the bug
62to cpan-RT.
63
64=head1 AUTHOR
65
66Stevan Little E<lt>stevan@iinteractive.comE<gt>
67
39b3bc94 68=head1 COPYRIGHT AND LICENSE
69
778db3ac 70Copyright 2006-2008 by Infinity Interactive, Inc.
39b3bc94 71
72L<http://www.iinteractive.com>
73
74This library is free software; you can redistribute it and/or modify
75it under the same terms as Perl itself.
76
cee532a1 77=cut