X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FREST.pm;h=6d650d903994e6dbe641f4ca8bbf805fcf73f74e;hb=d2d931018a9ce738f2e117cdc2fcd0987fe136ee;hp=e9ca9b0bea7a0f9efc70d2eef7fdfacd79c56785;hpb=3faede66379723f231f00d2eafeafbc97cc32750;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/REST.pm b/lib/Catalyst/Action/REST.pm index e9ca9b0..6d650d9 100644 --- a/lib/Catalyst/Action/REST.pm +++ b/lib/Catalyst/Action/REST.pm @@ -123,8 +123,8 @@ sub dispatch { $c->execute( $self->class, $self, @{ $c->req->args } ); } -my $_get_allowed_methods = sub { - my ( $controller, $c, $name ) = @_; +sub _get_allowed_methods { + my ( $self, $controller, $c, $name ) = @_; my $class = ref($controller) ? ref($controller) : $controller; my $methods = Class::Inspector->methods($class); my @allowed; @@ -138,7 +138,7 @@ my $_get_allowed_methods = sub { sub _return_options { my ( $self, $method_name, $controller, $c) = @_; - my @allowed = $controller->$_get_allowed_methods($c, $method_name); + my @allowed = $self->_get_allowed_methods($controller, $c, $method_name); $c->response->content_type('text/plain'); $c->response->status(200); $c->response->header( 'Allow' => \@allowed ); @@ -147,7 +147,7 @@ sub _return_options { sub _return_not_implemented { my ( $self, $method_name, $controller, $c ) = @_; - my @allowed = $controller->$_get_allowed_methods($c, $method_name); + my @allowed = $self->_get_allowed_methods($controller, $c, $method_name); $c->response->content_type('text/plain'); $c->response->status(405); $c->response->header( 'Allow' => \@allowed );