Class: Rubino::API::Operations::Tasks::ShowOperation
- Inherits:
-
Object
- Object
- Rubino::API::Operations::Tasks::ShowOperation
- Defined in:
- lib/rubino/api/operations/tasks/show_operation.rb
Overview
GET /v1/tasks/:id Full detail for one background subagent, including its complete result (on success) or error (on failure).
Class Method Summary collapse
Instance Method Summary collapse
- #call(request) ⇒ Object
-
#initialize(registry: nil) ⇒ ShowOperation
constructor
Accepts an alternate registry for tests.
Constructor Details
#initialize(registry: nil) ⇒ ShowOperation
Accepts an alternate registry for tests.
18 19 20 |
# File 'lib/rubino/api/operations/tasks/show_operation.rb', line 18 def initialize(registry: nil) @registry = registry || ::Rubino::Tools::BackgroundTasks.instance end |
Class Method Details
.call(request) ⇒ Object
13 14 15 |
# File 'lib/rubino/api/operations/tasks/show_operation.rb', line 13 def self.call(request) new.call(request) end |
Instance Method Details
#call(request) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/rubino/api/operations/tasks/show_operation.rb', line 22 def call(request) id = request.params.fetch("id") entry = @registry.find(id) raise NotFoundError.new("task", id) unless entry [200, Serializer.detail(entry)] end |