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.



646
647
648
649
650
651
652
653
# File 'lib/mechanize/test_case.rb', line 646

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



635
636
637
# File 'lib/mechanize/test_case.rb', line 635

def body
  @body
end

#codeObject Also known as: status

Returns the value of attribute code.



634
635
636
# File 'lib/mechanize/test_case.rb', line 634

def code
  @code
end

#cookiesObject

Returns the value of attribute cookies.



635
636
637
# File 'lib/mechanize/test_case.rb', line 635

def cookies
  @cookies
end

#headerObject

Returns the value of attribute header.



637
638
639
# File 'lib/mechanize/test_case.rb', line 637

def header
  @header
end

#http_versionObject

Returns the value of attribute http_version.



636
637
638
# File 'lib/mechanize/test_case.rb', line 636

def http_version
  @http_version
end

#queryObject

Returns the value of attribute query.



635
636
637
# File 'lib/mechanize/test_case.rb', line 635

def query
  @query
end

#query_paramsObject

Returns the value of attribute query_params.



636
637
638
# File 'lib/mechanize/test_case.rb', line 636

def query_params
  @query_params
end

Instance Method Details

#messageObject



659
660
661
# File 'lib/mechanize/test_case.rb', line 659

def message
  ''
end

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

Yields:



655
656
657
# File 'lib/mechanize/test_case.rb', line 655

def read_body
  yield body
end