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.



308
309
310
311
312
313
314
315
# File 'lib/mechanize/test_case.rb', line 308

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



297
298
299
# File 'lib/mechanize/test_case.rb', line 297

def body
  @body
end

#codeObject Also known as: status

Returns the value of attribute code.



296
297
298
# File 'lib/mechanize/test_case.rb', line 296

def code
  @code
end

#cookiesObject

Returns the value of attribute cookies.



297
298
299
# File 'lib/mechanize/test_case.rb', line 297

def cookies
  @cookies
end

#headerObject

Returns the value of attribute header.



299
300
301
# File 'lib/mechanize/test_case.rb', line 299

def header
  @header
end

#http_versionObject

Returns the value of attribute http_version.



298
299
300
# File 'lib/mechanize/test_case.rb', line 298

def http_version
  @http_version
end

#queryObject

Returns the value of attribute query.



297
298
299
# File 'lib/mechanize/test_case.rb', line 297

def query
  @query
end

#query_paramsObject

Returns the value of attribute query_params.



298
299
300
# File 'lib/mechanize/test_case.rb', line 298

def query_params
  @query_params
end

Instance Method Details

#messageObject



321
322
323
# File 'lib/mechanize/test_case.rb', line 321

def message
  ''
end

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

Yields:



317
318
319
# File 'lib/mechanize/test_case.rb', line 317

def read_body
  yield body
end