BEGIN { require 5.008001; }
-our $VERSION = '1.03';
-$VERSION = eval $VERSION;
-
sub BUILDARGS {
my $class = shift;
my $config = shift;
sub get_allowed_methods {
my ( $self, $controller, $c, $name ) = @_;
my $class = ref($controller) ? ref($controller) : $controller;
- my $methods = Class::Inspector->methods($class);
- return map { /^$name\_(.+)$/ } @$methods;
+ my $methods = {
+ map { /^$name\_(.+)$/ ? ( $1 => 1 ) : () }
+ @{ Class::Inspector->methods($class) }
+ };
+ $methods->{'HEAD'} = 1 if $methods->{'GET'};
+ delete $methods->{'not_implemented'};
+ return sort keys %$methods;
};
sub _return_options {