Class: Response

Inherits:
Object
  • Object
show all
Includes:
Net::HTTPHeader
Defined in:
lib/mechanize/test_case.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.



318
319
320
321
322
323
324
325
# File 'lib/mechanize/test_case.rb', line 318

def initialize
  @header = {}
  @body = String.new
  @code = nil
  @query = nil
  @cookies = []
  @http_version = '1.1'
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



307
308
309
# File 'lib/mechanize/test_case.rb', line 307

def body
  @body
end

#codeObject Also known as: status

Returns the value of attribute code.



306
307
308
# File 'lib/mechanize/test_case.rb', line 306

def code
  @code
end

#cookiesObject

Returns the value of attribute cookies.



307
308
309
# File 'lib/mechanize/test_case.rb', line 307

def cookies
  @cookies
end

#headerObject

Returns the value of attribute header.



309
310
311
# File 'lib/mechanize/test_case.rb', line 309

def header
  @header
end

#http_versionObject

Returns the value of attribute http_version.



308
309
310
# File 'lib/mechanize/test_case.rb', line 308

def http_version
  @http_version
end

#queryObject

Returns the value of attribute query.



307
308
309
# File 'lib/mechanize/test_case.rb', line 307

def query
  @query
end

#query_paramsObject

Returns the value of attribute query_params.



308
309
310
# File 'lib/mechanize/test_case.rb', line 308

def query_params
  @query_params
end

Instance Method Details

#messageObject



331
332
333
# File 'lib/mechanize/test_case.rb', line 331

def message
  ''
end

#read_body {|body| ... } ⇒ Object

Yields:



327
328
329
# File 'lib/mechanize/test_case.rb', line 327

def read_body
  yield body
end