提交 77f2ba95 编写于 作者: G Gosha Arinich

refactor Routing::Mapper

上级 ef61504c
......@@ -26,15 +26,10 @@ def initialize(app, constraints, request)
def matches?(env)
req = @request.new(env)
@constraints.each { |constraint|
if constraint.respond_to?(:matches?) && !constraint.matches?(req)
return false
elsif constraint.respond_to?(:call) && !constraint.call(*constraint_args(constraint, req))
return false
end
}
return true
@constraints.none? do |constraint|
(constraint.respond_to?(:matches?) && !constraint.matches?(req)) ||
(constraint.respond_to?(:call) && !constraint.call(*constraint_args(constraint, req)))
end
ensure
req.reset_parameters
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册