diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-02-18 12:25:57 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-02-18 12:25:57 -0600 |
commit | 18f07a26819d72517556849fc59c9860a90d3c9c (patch) | |
tree | 6fca0dbab71a937aa04705c6ff663999becbaf46 /lib/Narwhal/RouteBuilder | |
parent | f4b3b90c3ccef7deb127c3ea1fc46984d64db605 (diff) | |
download | narwhal-18f07a26819d72517556849fc59c9860a90d3c9c.tar.gz narwhal-18f07a26819d72517556849fc59c9860a90d3c9c.zip |
use new route builder api
Diffstat (limited to 'lib/Narwhal/RouteBuilder')
-rw-r--r-- | lib/Narwhal/RouteBuilder/HTTPMethod.pm | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/Narwhal/RouteBuilder/HTTPMethod.pm b/lib/Narwhal/RouteBuilder/HTTPMethod.pm index 9631616..33fe893 100644 --- a/lib/Narwhal/RouteBuilder/HTTPMethod.pm +++ b/lib/Narwhal/RouteBuilder/HTTPMethod.pm @@ -3,21 +3,6 @@ use Moose; with 'OX::RouteBuilder'; -sub import { - my $meta = Class::MOP::class_of(caller); - $meta->add_route_builder( - class => __PACKAGE__, - route_spec => sub { - my $spec = shift; - return if ref($spec); - return unless $spec =~ /^http-method:(\w+)$/; - return { - action => $1, - }; - }, - ); -} - sub compile_routes { my $self = shift; @@ -59,6 +44,16 @@ sub compile_routes { ]; } +sub parse_action_spec { + my $self = shift; + my ($action_spec) = @_; + return if ref($action_spec); + return unless $action_spec =~ /^http-method:(\w+)$/; + return { + action => $1, + }; +} + __PACKAGE__->meta->make_immutable; no Moose; |