Don't override Payload::Base#inspect.

There is no good reason for this class to pretend that it is a String.
It is not, and this was incredibly confusing behavior.
This commit is contained in:
Andy Brody 2015-11-16 03:08:39 -08:00
parent 014e421bfc
commit 6fb45b32ca
2 changed files with 3 additions and 3 deletions

View File

@ -69,6 +69,7 @@ This release is largely API compatible, but makes several breaking changes.
- Refactor URI parsing to happen earlier, in Request initialization.
- When adding URL params, handle URLs that already contain params.
- Multipart: use a much more robust multipart boundary with greater entropy.
- Make `RestClient::Payload::Base#inspect` stop pretending to be a String.
# 2.0.0.rc1

View File

@ -115,13 +115,12 @@ module RestClient
@stream.close unless @stream.closed?
end
def inspect
# TODO: make this not pretend to be a string (ugh)
def to_s_inspect
to_s.inspect
end
def short_inspect
(size > 500 ? "#{size} byte(s) length" : inspect)
(size > 500 ? "#{size} byte(s) length" : to_s_inspect)
end
end