lib/httpx/request.rb in httpx-0.17.0 vs lib/httpx/request.rb in httpx-0.18.0

- old
+ new

@@ -146,14 +146,14 @@ end # :nocov: def inspect "#<HTTPX::Request:#{object_id} " \ - "#{@verb.to_s.upcase} " \ - "#{uri} " \ - "@headers=#{@headers} " \ - "@body=#{@body}>" + "#{@verb.to_s.upcase} " \ + "#{uri} " \ + "@headers=#{@headers} " \ + "@body=#{@body}>" end # :nocov: class Body < SimpleDelegator class << self @@ -179,11 +179,11 @@ @headers["content-length"] = @body.bytesize unless unbounded_body? super(@body) end def each(&block) - return enum_for(__method__) unless block_given? + return enum_for(__method__) unless block return if @body.nil? body = stream(@body) if body.respond_to?(:read) ::IO.copy_stream(body, ProcIO.new(block)) @@ -234,10 +234,10 @@ end # :nocov: def inspect "#<HTTPX::Request::Body:#{object_id} " \ - "#{unbounded_body? ? "stream" : "@bytesize=#{bytesize}"}>" + "#{unbounded_body? ? "stream" : "@bytesize=#{bytesize}"}>" end # :nocov: end def transition(nextstate)