Methods

VCR::Net::HTTPResponse

Public Instance Methods

read_body(dest = nil, &block) click to toggle source
# File lib/vcr/extensions/net_http_response.rb, line 15
def read_body(dest = nil, &block)
  return super if @__read_body_previously_called
  return @body if dest.nil? && block.nil?
  raise ArgumentError.new("both arg and block given for HTTP method") if dest && block

  if @body
    dest ||= ::Net::ReadAdapter.new(block)
    dest << @body
    @body = dest
  end
ensure
  # allow subsequent calls to #read_body to proceed as normal, without our hack...
  @__read_body_previously_called = true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.