lib/restfulness/response.rb in restfulness-0.3.3 vs lib/restfulness/response.rb in restfulness-0.3.4

- old
+ new

@@ -50,22 +50,23 @@ def content_length payload.to_s.bytesize.to_s end + # Override the status of this response. + def status=(code) + @status = code.to_i + end + protected def resource=(obj) @resource = obj end def update_status_and_payload(status, payload = "") - self.status = status + self.status = status unless self.status.present? self.payload = payload - end - - def status=(code) - @status = code end def payload=(body) if body.nil? || body.is_a?(String) @payload = body.to_s