Bump version to 1.9900 for new version numbering scheme
[gitmo/Moose.git] / lib / Moose / Meta / Method.pm
CommitLineData
8ee73eeb 1package Moose::Meta::Method;
2
3use strict;
4use warnings;
5
bb8ef151 6our $VERSION = '1.9900';
e606ae5f 7$VERSION = eval $VERSION;
d44714be 8our $AUTHORITY = 'cpan:STEVAN';
8ee73eeb 9
d2782813 10use Class::MOP::MiniTrait;
11
8ee73eeb 12use base 'Class::MOP::Method';
13
d2782813 14Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
15
3e504337 16sub _error_thrower {
17 my $self = shift;
18748ad6 18 ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class";
3e504337 19}
20
cee532a1 21sub throw_error {
22 my $self = shift;
3e504337 23 my $inv = $self->_error_thrower;
cee532a1 24 unshift @_, "message" if @_ % 2 == 1;
25 unshift @_, method => $self if ref $self;
26 unshift @_, $inv;
ffa3d7bf 27 my $handler = $inv->can("throw_error");
28 goto $handler; # to avoid incrementing depth by 1
cee532a1 29}
30
31sub _inline_throw_error {
32 my ( $self, $msg, $args ) = @_;
33 "\$meta->throw_error($msg" . ($args ? ", $args" : "") . ")"; # FIXME makes deparsing *REALLY* hard
34}
35
8ee73eeb 361;
37
38__END__
39
40=pod
41
39b3bc94 42=head1 NAME
43
ecb59493 44Moose::Meta::Method - A Moose Method metaclass
39b3bc94 45
46=head1 DESCRIPTION
47
bef3ee55 48This class is a subclass of L<Class::MOP::Method> that provides
e3177578 49additional Moose-specific functionality, all of which is private.
39b3bc94 50
bef3ee55 51To understand this class, you should read the the L<Class::MOP::Method>
e3177578 52documentation.
cee532a1 53
d4b1449e 54=head1 INHERITANCE
55
56C<Moose::Meta::Method> is a subclass of L<Class::MOP::Method>.
57
39b3bc94 58=head1 BUGS
59
d4048ef3 60See L<Moose/BUGS> for details on reporting bugs.
39b3bc94 61
62=head1 AUTHOR
63
64Stevan Little E<lt>stevan@iinteractive.comE<gt>
65
39b3bc94 66=head1 COPYRIGHT AND LICENSE
67
7e0492d3 68Copyright 2006-2010 by Infinity Interactive, Inc.
39b3bc94 69
70L<http://www.iinteractive.com>
71
72This library is free software; you can redistribute it and/or modify
73it under the same terms as Perl itself.
74
cee532a1 75=cut