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 String response.write v when Array throw :halt, v else raise Roda::RodaError, "singular argument to #halt must be Integer, String, or Array" end when 2 resp = response resp.status = res[0] resp.write res[1] when 3 resp = response resp.status = res[0] resp.headers.merge!(res[1]) resp.write res[2] else raise Roda::RodaError, "too many arguments given to #halt (accepts 0-3, received #{res.length})" end super() end