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, scope:) ⇒ 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, scope:)
  super()
  @body = body
  @status = status
  @headers = headers.each_with_object({}) { |(k, v), h| h[k.downcase] = v }
  @scope = scope
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

#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

#scopeObject (readonly)

Returns the value of attribute scope.



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

def scope
  @scope
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