1 package Moose::Meta::Method::Overriden;
8 our $VERSION = '0.55_04';
9 $VERSION = eval $VERSION;
10 our $AUTHORITY = 'cpan:STEVAN';
12 use base 'Moose::Meta::Method';
15 my ( $class, %args ) = @_;
17 # the package can be overridden by roles
18 # it is really more like body's compilation stash
19 # this is where we need to override the definition of super() so that the
20 # body of the code can call the right overridden version
21 my $_super_package = $args{package} || $args{class}->name;
23 my $name = $args{name};
25 my $super = $args{class}->find_next_method_by_name($name);
28 || confess "You cannot override '$name' because it has no super method";
30 my $super_body = $super->body;
32 my $method = $args{method};
35 local @Moose::SUPER_ARGS = @_;
36 local $Moose::SUPER_BODY = $super_body;
40 # FIXME do we need this make sure this works for next::method?
41 # subname "${_super_package}::${name}", $method;
43 # FIXME store additional attrs
46 package_name => $args{class}->name,
59 Moose::Meta::Method::Overriden - A Moose Method metaclass for overriden methods
63 This class implements method overriding logic for the L<Moose> C<override> keyword.
65 This involves setting up C<super> for the overriding body, and dispatching to
66 the correct parent method upon its invocation.
78 All complex software has bugs lurking in it, and this module is no
79 exception. If you find a bug please either email me, or add the bug
84 Yuval Kogman E<lt>nothingmuch@cpan.orgE<gt>
86 =head1 COPYRIGHT AND LICENSE
88 Copyright 2006-2008 by Infinity Interactive, Inc.
90 L<http://www.iinteractive.com>
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.