Class: Net::HTTPResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/net_http_hacked.rb

Instance Method Summary collapse

Instance Method Details

#begin_reading_body_hacked(sock, reqmethodallowbody) ⇒ Object

Original #reading_body with block semantics

def reading_body(sock, reqmethodallowbody) #:nodoc: internal use only

@socket = sock
@body_exist = reqmethodallowbody && self.class.body_permitted?
begin
  yield
  self.body   # ensure to read body
ensure
  @socket = nil
end

end



81
82
83
84
# File 'lib/net_http_hacked.rb', line 81

def begin_reading_body_hacked(sock, reqmethodallowbody)
  @socket = sock
  @body_exist = reqmethodallowbody && self.class.body_permitted?
end

#end_reading_body_hackedObject



86
87
88
89
# File 'lib/net_http_hacked.rb', line 86

def end_reading_body_hacked
  self.body
  @socket = nil
end