lib/http_utilities/http/response.rb in http_utilities-1.2.6.5 vs lib/http_utilities/http/response.rb in http_utilities-1.2.7

- old
+ new

@@ -1,12 +1,13 @@ module HttpUtilities module Http class Response include HttpUtilities::Http::Logger - attr_accessor :body, :parsed_body, :page, :format, :request, :force_encoding + attr_accessor :status, :body, :parsed_body, :page, :format, :request, :force_encoding def initialize(response: nil, request: nil, options: {}) + self.status = (response && response.status) ? response.status : nil self.body = (response && response.body) ? response.body : nil self.request = request self.parsed_body = nil