summaryrefslogtreecommitdiffstats
path: root/lib/Narwhal/RouteBuilder/HTTPMethod.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Narwhal/RouteBuilder/HTTPMethod.pm')
-rw-r--r--lib/Narwhal/RouteBuilder/HTTPMethod.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Narwhal/RouteBuilder/HTTPMethod.pm b/lib/Narwhal/RouteBuilder/HTTPMethod.pm
index fb2f124..9631616 100644
--- a/lib/Narwhal/RouteBuilder/HTTPMethod.pm
+++ b/lib/Narwhal/RouteBuilder/HTTPMethod.pm
@@ -9,9 +9,10 @@ sub import {
class => __PACKAGE__,
route_spec => sub {
my $spec = shift;
- return if ref($spec) || $spec !~ /^\w+$/;
+ return if ref($spec);
+ return unless $spec =~ /^http-method:(\w+)$/;
return {
- action => $spec,
+ action => $1,
};
},
);