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.



297
298
299
300
301
302
303
304
# File 'lib/mechanize/test_case.rb', line 297

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



286
287
288
# File 'lib/mechanize/test_case.rb', line 286

def body
  @body
end

#codeObject Also known as: status

Returns the value of attribute code.



285
286
287
# File 'lib/mechanize/test_case.rb', line 285

def code
  @code
end

#cookiesObject

Returns the value of attribute cookies.



286
287
288
# File 'lib/mechanize/test_case.rb', line 286

def cookies
  @cookies
end

#headerObject

Returns the value of attribute header.



288
289
290
# File 'lib/mechanize/test_case.rb', line 288

def header
  @header
end

#http_versionObject

Returns the value of attribute http_version.



287
288
289
# File 'lib/mechanize/test_case.rb', line 287

def http_version
  @http_version
end

#queryObject

Returns the value of attribute query.



286
287
288
# File 'lib/mechanize/test_case.rb', line 286

def query
  @query
end

#query_paramsObject

Returns the value of attribute query_params.



287
288
289
# File 'lib/mechanize/test_case.rb', line 287

def query_params
  @query_params
end

Instance Method Details

#messageObject



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

def message
  ''
end

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

Yields:



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

def read_body
  yield body
end