Class: Datadog::AppSec::Response
- Inherits:
-
Object
- Object
- Datadog::AppSec::Response
- Defined in:
- lib/datadog/appsec/response.rb
Overview
AppSec response
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(status:, headers: {}, body: []) ⇒ Response
constructor
A new instance of Response.
- #to_action_dispatch_response ⇒ Object
- #to_rack ⇒ Object
- #to_sinatra_response ⇒ Object
Constructor Details
#initialize(status:, headers: {}, body: []) ⇒ Response
Returns a new instance of Response.
10 11 12 13 14 |
# File 'lib/datadog/appsec/response.rb', line 10 def initialize(status:, headers: {}, body: []) @status = status @headers = headers @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/datadog/appsec/response.rb', line 8 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
8 9 10 |
# File 'lib/datadog/appsec/response.rb', line 8 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/datadog/appsec/response.rb', line 8 def status @status end |
Class Method Details
Instance Method Details
#to_action_dispatch_response ⇒ Object
24 25 26 |
# File 'lib/datadog/appsec/response.rb', line 24 def to_action_dispatch_response ::ActionDispatch::Response.new(status, headers, body) end |
#to_rack ⇒ Object
16 17 18 |
# File 'lib/datadog/appsec/response.rb', line 16 def to_rack [status, headers, body] end |
#to_sinatra_response ⇒ Object
20 21 22 |
# File 'lib/datadog/appsec/response.rb', line 20 def to_sinatra_response ::Sinatra::Response.new(body, status, headers) end |