module Roda::RodaPlugins::Halt::RequestMethods
def halt(*res)
def halt(*res) case res.length when 0 # do nothing when 1 case v = res[0] when Integer response.status = v when Array throw :halt, v else if result = block_result_body(v) response.write(result) else raise Roda::RodaError, "singular argument given to #halt not handled: #{v.inspect}" end end when 2 resp = response resp.status = res[0] resp.write(block_result_body(res[1])) when 3 resp = response resp.status = res[0] resp.headers.merge!(res[1]) resp.write(block_result_body(res[2])) else raise Roda::RodaError, "too many arguments given to #halt (accepts 0-3, received #{res.length})" end super() end