Class: HTTPcap::Response

Inherits:
Message show all
Defined in:
lib/httpcap/response.rb

Overview

Response

Instance Attribute Summary collapse

Attributes inherited from Message

#body, #headers

Instance Method Summary collapse

Methods inherited from Message

#on_body, #on_header_field, #on_header_value, #on_headers_complete, #on_url, #receive_data

Constructor Details

#initialize(data) ⇒ Response

Returns a new instance of Response.



10
11
12
13
14
# File 'lib/httpcap/response.rb', line 10

def initialize(data)
  @http_status = ''

  super(HTTP::Parser::TYPE_RESPONSE, data)
end

Instance Attribute Details

#http_statusObject (readonly)

Returns the value of attribute http_status.



8
9
10
# File 'lib/httpcap/response.rb', line 8

def http_status
  @http_status
end

Instance Method Details

#on_message_completeObject



16
17
18
# File 'lib/httpcap/response.rb', line 16

def on_message_complete
  @http_status = @parser.http_status
end