Class: Net::HTTPResponse
- Inherits:
-
Object
- Object
- Net::HTTPResponse
- Defined in:
- lib/net_http_hacked.rb
Instance Method Summary collapse
-
#begin_reading_body_hacked(sock, reqmethodallowbody) ⇒ Object
Original #reading_body with block semantics.
- #end_reading_body_hacked ⇒ Object
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_hacked ⇒ Object
86 87 88 89 |
# File 'lib/net_http_hacked.rb', line 86 def end_reading_body_hacked self.body @socket = nil end |