Class: Datadog::AppSec::Contrib::Rack::Gateway::Response

Inherits:
Instrumentation::Gateway::Argument show all
Defined in:
lib/datadog/appsec/contrib/rack/gateway/response.rb

Overview

Gateway Response argument.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body, status, headers, context:) ⇒ Response

Returns a new instance of Response.



14
15
16
17
18
19
20
# File 'lib/datadog/appsec/contrib/rack/gateway/response.rb', line 14

def initialize(body, status, headers, context:)
  super()
  @body = body
  @status = status
  @headers = headers.each_with_object({}) { |(k, v), h| h[k.downcase] = v }
  @context = context
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



12
13
14
# File 'lib/datadog/appsec/contrib/rack/gateway/response.rb', line 12

def body
  @body
end

#contextObject (readonly)

Returns the value of attribute context.



12
13
14
# File 'lib/datadog/appsec/contrib/rack/gateway/response.rb', line 12

def context
  @context
end

#headersObject (readonly)

Returns the value of attribute headers.



12
13
14
# File 'lib/datadog/appsec/contrib/rack/gateway/response.rb', line 12

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/datadog/appsec/contrib/rack/gateway/response.rb', line 12

def status
  @status
end

Instance Method Details

#responseObject



22
23
24
# File 'lib/datadog/appsec/contrib/rack/gateway/response.rb', line 22

def response
  @response ||= ::Rack::Response.new(body, status, headers)
end