Class: Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.



662
663
664
665
666
667
668
669
# File 'lib/mechanize/test_case.rb', line 662

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



651
652
653
# File 'lib/mechanize/test_case.rb', line 651

def body
  @body
end

#codeObject Also known as: status

Returns the value of attribute code.



650
651
652
# File 'lib/mechanize/test_case.rb', line 650

def code
  @code
end

#cookiesObject

Returns the value of attribute cookies.



651
652
653
# File 'lib/mechanize/test_case.rb', line 651

def cookies
  @cookies
end

#headerObject

Returns the value of attribute header.



653
654
655
# File 'lib/mechanize/test_case.rb', line 653

def header
  @header
end

#http_versionObject

Returns the value of attribute http_version.



652
653
654
# File 'lib/mechanize/test_case.rb', line 652

def http_version
  @http_version
end

#queryObject

Returns the value of attribute query.



651
652
653
# File 'lib/mechanize/test_case.rb', line 651

def query
  @query
end

#query_paramsObject

Returns the value of attribute query_params.



652
653
654
# File 'lib/mechanize/test_case.rb', line 652

def query_params
  @query_params
end

Instance Method Details

#messageObject



675
676
677
# File 'lib/mechanize/test_case.rb', line 675

def message
  ''
end

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

Yields:



671
672
673
# File 'lib/mechanize/test_case.rb', line 671

def read_body
  yield body
end