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

#initialize ⇒ Response

Returns a new instance of Response.



654
655
656
657
658
659
660
661
# File 'lib/mechanize/test_case.rb', line 654

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

Instance Attribute Details

#body ⇒ Object

Returns the value of attribute body.



643
644
645
# File 'lib/mechanize/test_case.rb', line 643

def body
  @body
end

#code ⇒ Object Also known as: status

Returns the value of attribute code.



642
643
644
# File 'lib/mechanize/test_case.rb', line 642

def code
  @code
end

#cookies ⇒ Object

Returns the value of attribute cookies.



643
644
645
# File 'lib/mechanize/test_case.rb', line 643

def cookies
  @cookies
end

#header ⇒ Object

Returns the value of attribute header.



645
646
647
# File 'lib/mechanize/test_case.rb', line 645

def header
  @header
end

#http_version ⇒ Object

Returns the value of attribute http_version.



644
645
646
# File 'lib/mechanize/test_case.rb', line 644

def http_version
  @http_version
end

#query ⇒ Object

Returns the value of attribute query.



643
644
645
# File 'lib/mechanize/test_case.rb', line 643

def query
  @query
end

#query_params ⇒ Object

Returns the value of attribute query_params.



644
645
646
# File 'lib/mechanize/test_case.rb', line 644

def query_params
  @query_params
end

Instance Method Details

#message ⇒ Object



667
668
669
# File 'lib/mechanize/test_case.rb', line 667

def message
  ''
end

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

Yields:



663
664
665
# File 'lib/mechanize/test_case.rb', line 663

def read_body
  yield body
end