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).
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.
14 15 16 |
# File 'lib/rubino/api/operations/tasks/show_operation.rb', line 14 def initialize(registry: nil) @registry = registry || ::Rubino::Tools::BackgroundTasks.instance end |
Instance Method Details
#call(request) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/rubino/api/operations/tasks/show_operation.rb', line 18 def call(request) id = request.params.fetch("id") entry = @registry.find(id) raise NotFoundError.new("task", id) unless entry [200, Serializer.detail(entry)] end |