Class: CommandTower::Auth::RequestContext
- Inherits:
-
Object
- Object
- CommandTower::Auth::RequestContext
- Defined in:
- app/services/command_tower/auth/request_context.rb
Overview
Transport handle passed from a controller boundary into authentication. Keeps the request/response pair together so services never reach for controller state directly. Not a workflow type.
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(request:, response:) ⇒ RequestContext
constructor
A new instance of RequestContext.
Constructor Details
#initialize(request:, response:) ⇒ RequestContext
Returns a new instance of RequestContext.
15 16 17 18 |
# File 'app/services/command_tower/auth/request_context.rb', line 15 def initialize(request:, response:) @request = request @response = response end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
9 10 11 |
# File 'app/services/command_tower/auth/request_context.rb', line 9 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'app/services/command_tower/auth/request_context.rb', line 9 def response @response end |
Class Method Details
.from(request, response) ⇒ Object
11 12 13 |
# File 'app/services/command_tower/auth/request_context.rb', line 11 def self.from(request, response) new(request:, response:) end |