Class: Wreq::Response
- Inherits:
-
Object
- Object
- Wreq::Response
- Defined in:
- lib/wreq_ruby/response.rb
Instance Method Summary collapse
-
#inspect ⇒ String
Returns a compact string representation for debugging.
-
#to_s ⇒ String
Returns the response body as a string.
Instance Method Details
#inspect ⇒ String
Returns a compact string representation for debugging.
Format: #<Wreq::Response STATUS content-type="..." body=SIZE>
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/wreq_ruby/response.rb', line 196 def inspect parts = ["#<Wreq::Response"] parts << code.to_s if headers.respond_to?(:get) content_type = headers.get("content-type") parts << "content-type=#{content_type.inspect}" if content_type end if content_length parts << "body=#{format_bytes(content_length)}" end parts.join(" ") + ">" end |
#to_s ⇒ String
Returns the response body as a string.
184 185 186 |
# File 'lib/wreq_ruby/response.rb', line 184 def to_s text end |