From bf8aed814305da26ba1bb1cf454740df1246789a Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 30 Sep 2013 23:42:25 -0700 Subject: [PATCH] Friendlier inspect for request bodies --- lib/reel/request_body.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/reel/request_body.rb b/lib/reel/request_body.rb index fe7fa13..7b3396d 100644 --- a/lib/reel/request_body.rb +++ b/lib/reel/request_body.rb @@ -47,10 +47,16 @@ def to_s @contents end + # Easier to interpret string inspect + def inspect + "#<#{self.class}:#{object_id.to_s(16)} @streaming=#{!!@streaming}>" + end + # Assert that the body is actively being streamed def stream! raise StateError, "body has already been consumed" if @streaming == false @streaming = true end + private :stream! end end