diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-22 17:31:29 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-22 17:31:29 -0800 |
commit | e7ef57dd0ddec3d487d3ffd58ff028bdf11a33f9 (patch) | |
tree | dfc9e049c937a56c2fc1e80ae8e8b71880d1615d /actionpack/lib/action_dispatch/http/status_codes.rb | |
parent | ec095456d859da4a09c7401585c211dc0f01fccd (diff) | |
parent | f737c2d69bb3659a553c7c0e21e316b1a4a1b98a (diff) | |
download | rails-e7ef57dd0ddec3d487d3ffd58ff028bdf11a33f9.tar.gz rails-e7ef57dd0ddec3d487d3ffd58ff028bdf11a33f9.tar.bz2 rails-e7ef57dd0ddec3d487d3ffd58ff028bdf11a33f9.zip |
Merge
Diffstat (limited to 'actionpack/lib/action_dispatch/http/status_codes.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/http/status_codes.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/actionpack/lib/action_dispatch/http/status_codes.rb b/actionpack/lib/action_dispatch/http/status_codes.rb deleted file mode 100644 index 3d6ee685ea..0000000000 --- a/actionpack/lib/action_dispatch/http/status_codes.rb +++ /dev/null @@ -1,33 +0,0 @@ -require 'active_support/inflector' - -module ActionDispatch - module StatusCodes #:nodoc: - STATUS_CODES = Rack::Utils::HTTP_STATUS_CODES.merge({ - 102 => "Processing", - 207 => "Multi-Status", - 226 => "IM Used", - 422 => "Unprocessable Entity", - 423 => "Locked", - 424 => "Failed Dependency", - 426 => "Upgrade Required", - 507 => "Insufficient Storage", - 510 => "Not Extended" - }).freeze - - def self.[](status) - if status.is_a?(Symbol) - SYMBOL_TO_STATUS_CODE[status] || 500 - else - status.to_i - end - end - - # Provides a symbol-to-fixnum lookup for converting a symbol (like - # :created or :not_implemented) into its corresponding HTTP status - # code (like 200 or 501). - SYMBOL_TO_STATUS_CODE = STATUS_CODES.inject({}) { |hash, (code, message)| - hash[ActiveSupport::Inflector.underscore(message.gsub(/ /, "")).to_sym] = code - hash - }.freeze - end -end |