Sha256: 5fd3fae8c8986a9510febf9a7cc3a4066011fe7ccbc0f1796cc744ac4aa7161e

Contents?: true

Size: 238 Bytes

Versions: 3

Compression:

Stored size: 238 Bytes

Contents

module Rack::App::InstanceMethods::HTTPStatus

  def http_status!(code, body=nil)
    raise unless code.is_a?(Integer)
    response.status = code
    respond_with(body || Rack::App::Constants::HTTP_STATUS_CODES[code] || raise)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-app-11.0.2 lib/rack/app/instance_methods/http_status.rb
rack-app-11.0.1 lib/rack/app/instance_methods/http_status.rb
rack-app-11.0.0 lib/rack/app/instance_methods/http_status.rb