X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FAugmented.pm;h=fdb91b8af20c5db40fa569be186a949408bc9a18;hb=0f1a71fc19c13d0a223fab58d7807fb4d45beab7;hp=46240546ba8e4d8a66595af380a2201179bfcac2;hpb=fb4fcfee39263ca3983e28f840f38185282d4327;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Augmented.pm b/lib/Moose/Meta/Method/Augmented.pm index 4624054..fdb91b8 100644 --- a/lib/Moose/Meta/Method/Augmented.pm +++ b/lib/Moose/Meta/Method/Augmented.pm @@ -3,12 +3,6 @@ package Moose::Meta::Method::Augmented; use strict; use warnings; -use Carp 'confess'; - -our $VERSION = '0.57'; -$VERSION = eval $VERSION; -our $AUTHORITY = 'cpan:STEVAN'; - use base 'Moose::Meta::Method'; sub new { @@ -24,11 +18,11 @@ sub new { my $super = $meta->find_next_method_by_name($name); (defined $super) - || confess "You cannot augment '$name' because it has no super method"; + || $meta->throw_error("You cannot augment '$name' because it has no super method", data => $name); my $_super_package = $super->package_name; - # BUT!,... if this is an overriden method .... - if ($super->isa('Moose::Meta::Method::Overriden')) { + # BUT!,... if this is an overridden method .... + if ($super->isa('Moose::Meta::Method::Overridden')) { # we need to be sure that we actually # find the next method, which is not # an 'override' method, the reason is @@ -58,49 +52,55 @@ sub new { 1; +# ABSTRACT: A Moose Method metaclass for augmented methods + __END__ =pod -=head1 NAME - -Moose::Meta::Method::Augmented - A Moose Method metaclass for augmented methods - =head1 DESCRIPTION -This class implements method augmenting logic for the L C keyword. +This class implements method augmentation logic for the L +C keyword. + +The augmentation subroutine reference will be invoked explicitly using +the C keyword from the parent class's method definition. -This involves setting up C for the superclass body, and dispatching to -the superclass from the normal body. +=head1 INHERITANCE -The subclass definition (the augmentation itself) will be invoked explicitly -using the C keyword from the parent class's method definition. +C is a subclass of L. =head1 METHODS =over 4 -=item B +=item B<< Moose::Meta::Method::Augmented->new(%options) >> -=back +This constructs a new object. It accepts the following options: -=head1 BUGS +=over 8 + +=item * class -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. +The metaclass object for the class in which the augmentation is being +declared. This option is required. -=head1 AUTHOR +=item * name -Yuval Kogman Enothingmuch@cpan.orgE +The name of the method which we are augmenting. This method must exist +in one of the class's superclasses. This option is required. -=head1 COPYRIGHT AND LICENSE +=item * method -Copyright 2006-2008 by Infinity Interactive, Inc. +The subroutine reference which implements the augmentation. This +option is required. + +=back -L +=back + +=head1 BUGS -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. +See L for details on reporting bugs. =cut