module Roda::RodaPlugins::SymbolStatus

  1. lib/roda/plugins/symbol_status.rb

The symbol_status plugin patches the status= response method to accept the status name as a symbol. If given an integer value, the default behaviour is used.

Examples:

r.is "needs_authorization" do
  response.status = :unauthorized
end
r.is "nothing" do
  response.status = :no_content
end

The conversion is done through Rack::Utils.status_code.