Added param_parser specs

This commit is contained in:
Sdogruyol 2015-10-28 20:38:24 +02:00
parent 3cc50e0a7e
commit ad6baba12b
3 changed files with 19 additions and 8 deletions

View file

@ -22,7 +22,7 @@ class Kemal::Handler < HTTP::Handler
@routes.each do |route|
match = route.match?(request)
if match
params = Kemal::Params.new(route, request).parse
params = Kemal::ParamParser.new(route, request).parse
context = Context.new(request, params.not_nil!)
begin
body = route.handler.call(context).to_s

View file

@ -1,4 +1,4 @@
class Kemal::Params
class Kemal::ParamParser
def initialize(@route, @request)
@route_components = route.components
@request_components = request.path.not_nil!.split "/"