Class: Wreq::Response
- Inherits:
-
Object
- Object
- Wreq::Response
- Defined in:
- lib/wreq_ruby/response.rb
Instance Method Summary collapse
-
#to_s ⇒ String
Returns a compact string representation of the response.
Instance Method Details
#to_s ⇒ String
Returns a compact string representation of the response.
Format: #<Wreq::Response STATUS content-type=“…” body=SIZE>
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/wreq_ruby/response.rb', line 167 def to_s parts = ["#<Wreq::Response"] # Status code parts << code.to_s # Content-Type header if present if headers.respond_to?(:get) content_type = headers.get("content-type") parts << "content-type=#{content_type.inspect}" if content_type end # Body size if content_length parts << "body=#{format_bytes(content_length)}" end parts.join(" ") + ">" end |