Fixed WithAcceptContext to use params correctly
André Walker [Fri, 29 Jul 2011 04:00:02 +0000 (01:00 -0300)]
lib/Catalyst/IOC/Service/WithAcceptContext.pm

index 8f4ebfc..713ca92 100644 (file)
@@ -10,12 +10,13 @@ has accept_context_sub => (
 );
 
 around 'get' => sub {
-    my ( $orig, $self, %params ) = @_;
+    my $orig = shift;
+    my $self = shift;
 
-    my $accept_context_args = delete $params{accept_context_args};
+    my $instance = $self->$orig(@_);
 
-    my $instance = $self->$orig(%params);
-    my $ac_sub   = $self->accept_context_sub;
+    my $accept_context_args = $self->param('accept_context_args');
+    my $ac_sub = $self->accept_context_sub;
 
     if ( $accept_context_args && $instance->can($ac_sub) ) {
         return $instance->$ac_sub( @$accept_context_args );
@@ -33,7 +34,7 @@ __END__
 
 =head1 NAME
 
-Catalyst::Service::WithContext
+Catalyst::Service::WithAcceptContext
 
 =head1 DESCRIPTION