1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

better warning message

This commit is contained in:
Julien Kirch 2010-02-23 18:05:15 +01:00
parent 6860a4ee35
commit 72673af123

View file

@ -6,6 +6,8 @@ module RestClient
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 || ""
@ -13,7 +15,7 @@ module RestClient
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
@ -26,7 +28,7 @@ module RestClient
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