private Method

ActionController.interpret_status(status)

Given a status parameter, determine whether it needs to be converted to a string. If it is a fixnum, use the STATUS_CODES hash to lookup the default message. If it is a symbol, use the SYMBOL_TO_STATUS_CODE hash to convert it.

Source Code

# File action_controller/status_codes.rb, line 74
def interpret_status(status)
  case status
  when Fixnum then
    "#{status} #{STATUS_CODES[status]}".strip
  when Symbol then
    interpret_status(SYMBOL_TO_STATUS_CODE[status] ||
      "500 Unknown Status #{status.inspect}")
  else
    status.to_s
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.