Class: Net::HTTPResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/rb-gae-support/net_http.rb

Overview

Monkey Patching bundled Net::HTTPResponse Library for java.new.URLConnection

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#body=(value) ⇒ Object (writeonly)

This is where the body is put by Net::HTTP#request



88
89
90
# File 'lib/rb-gae-support/net_http.rb', line 88

def body=(value)
  @body = value
end

Instance Method Details

#read_body(dest = nil, &block) ⇒ Object

Reads the response body. In our case the body has already been set in the request.



92
93
94
95
96
97
98
99
# File 'lib/rb-gae-support/net_http.rb', line 92

def read_body(dest = nil, &block)
  # TODO - handle block situation better, rather than one dump.
  if block
    yield @body
  else
    @body
  end
end