lib/restclient/response.rb in rest-client-1.4.0.a vs lib/restclient/response.rb in rest-client-1.4.0
- old
+ new
@@ -4,18 +4,20 @@
#
class Response < AbstractResponse
attr_reader :body
+ WARNING_MESSAGE = '[warning] The Response is no more a String and the Response content is now accessed through Response.body, please update your code'
+
def initialize body, net_http_res, args
super net_http_res, args
@body = body || ""
end
def method_missing symbol, *args
if body.respond_to? symbol
- warn "[warning] The Response is no more a String, please update your code"
+ warn WARNING_MESSAGE
body.send symbol, *args
else
super
end
end
@@ -24,10 +26,10 @@
if super
true
else
equal_body = (body == o)
if equal_body
- warn "[warning] The Response is no more a String, please update your code"
+ warn WARNING_MESSAGE
end
equal_body
end
end