aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/response.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/http/response.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb56
1 files changed, 0 insertions, 56 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index 1b12308cc9..2b969323ca 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -31,14 +31,6 @@ module ActionDispatch # :nodoc:
# end
# end
class Response < Rack::Response
- def self.from_response(response)
- new.tap do |resp|
- resp.status = response.status
- resp.headers = response.headers
- resp.body = response.body
- end
- end
-
DEFAULT_HEADERS = { "Cache-Control" => "no-cache" }
attr_accessor :request
@@ -47,27 +39,6 @@ module ActionDispatch # :nodoc:
attr_writer :header
alias_method :headers=, :header=
- def template
- ActiveSupport::Deprecation.warn("response.template has been deprecated. Use controller.template instead", caller)
- @template
- end
- attr_writer :template
-
- def session
- ActiveSupport::Deprecation.warn("response.session has been deprecated. Use request.session instead", caller)
- @request.session
- end
-
- def assigns
- ActiveSupport::Deprecation.warn("response.assigns has been deprecated. Use controller.assigns instead", caller)
- @template.controller.assigns
- end
-
- def layout
- ActiveSupport::Deprecation.warn("response.layout has been deprecated. Use template.layout instead", caller)
- @template.layout
- end
-
delegate :default_charset, :to => 'ActionController::Base'
def initialize
@@ -90,33 +61,6 @@ module ActionDispatch # :nodoc:
end
alias_method :status_message, :message
- # Was the response successful?
- def success?
- (200..299).include?(response_code)
- end
-
- # Was the URL not found?
- def missing?
- response_code == 404
- end
-
- # Were we redirected?
- def redirect?
- (300..399).include?(response_code)
- end
-
- # Was there a server-side error?
- def error?
- (500..599).include?(response_code)
- end
-
- alias_method :server_error?, :error?
-
- # Was there a client client?
- def client_error?
- (400..499).include?(response_code)
- end
-
def body
str = ''
each { |part| str << part.to_s }