Class: OrchestraAI::Task
- Inherits:
-
Object
- Object
- OrchestraAI::Task
- Defined in:
- lib/orchestra_ai/task.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#key ⇒ Object
Returns the value of attribute key.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(id:, key:, params: {}) ⇒ Task
constructor
A new instance of Task.
- #result ⇒ Object
Constructor Details
#initialize(id:, key:, params: {}) ⇒ Task
Returns a new instance of Task.
7 8 9 10 11 |
# File 'lib/orchestra_ai/task.rb', line 7 def initialize(id:, key:, params: {}) @id = id @key = key @params = params end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/orchestra_ai/task.rb', line 5 def id @id end |
#key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/orchestra_ai/task.rb', line 5 def key @key end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/orchestra_ai/task.rb', line 5 def params @params end |
Instance Method Details
#result ⇒ Object
13 14 15 16 |
# File 'lib/orchestra_ai/task.rb', line 13 def result action = Object.const_get(key).new Result.new(action:, result: action.perform(**@params)) end |