Class: FlowChat::BackgroundController
- Inherits:
-
Object
- Object
- FlowChat::BackgroundController
- Defined in:
- lib/flow_chat/async_job.rb
Overview
Duck-type controller for background jobs Provides render/head no-ops and request interface
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #head(status) ⇒ Object
-
#initialize(request_data) ⇒ BackgroundController
constructor
A new instance of BackgroundController.
- #is_a?(klass) ⇒ Boolean
- #kind_of?(klass) ⇒ Boolean
-
#params ⇒ Object
Delegate params to request (mimics Rails controller behavior).
- #render(options) ⇒ Object
Constructor Details
#initialize(request_data) ⇒ BackgroundController
Returns a new instance of BackgroundController.
70 71 72 73 74 |
# File 'lib/flow_chat/async_job.rb', line 70 def initialize(request_data) FlowChat.logger.debug { "BackgroundController: Initializing with request data" } @request = BackgroundRequest.new(request_data) @response = nil end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
68 69 70 |
# File 'lib/flow_chat/async_job.rb', line 68 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
68 69 70 |
# File 'lib/flow_chat/async_job.rb', line 68 def response @response end |
Instance Method Details
#head(status) ⇒ Object
87 88 89 90 91 |
# File 'lib/flow_chat/async_job.rb', line 87 def head(status) FlowChat.logger.debug { "BackgroundController: head called (no-op): #{status}" } @response = {status: status} nil # No-op in background end |
#is_a?(klass) ⇒ Boolean
93 94 95 96 |
# File 'lib/flow_chat/async_job.rb', line 93 def is_a?(klass) return true if klass == FlowChat::BackgroundController super end |
#kind_of?(klass) ⇒ Boolean
98 99 100 101 |
# File 'lib/flow_chat/async_job.rb', line 98 def kind_of?(klass) return true if klass == FlowChat::BackgroundController super end |
#params ⇒ Object
Delegate params to request (mimics Rails controller behavior)
77 78 79 |
# File 'lib/flow_chat/async_job.rb', line 77 def params request.params end |