From: Dave Rolsky Date: Thu, 11 Sep 2008 16:30:04 +0000 (+0000) Subject: Simplify wrap_method_body now that Method->wrap takes named args. X-Git-Tag: 0.66~3^2~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ea73420630f6ececd1371bfaa6666d31f847feed;p=gitmo%2FClass-MOP.git Simplify wrap_method_body now that Method->wrap takes named args. --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 70124b9..bc7c269 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -591,15 +591,13 @@ sub class_precedence_list { sub wrap_method_body { my ( $self, %args ) = @_; - my $body = delete $args{body}; # delete is for compat - - ('CODE' eq ref($body)) + ('CODE' eq ref $args{body}) || confess "Your code block must be a CODE reference"; - $self->method_metaclass->wrap( $body => ( + $self->method_metaclass->wrap( package_name => $self->name, %args, - )); + ); } sub add_method {