Class: Agents::Actions::DelegateAction
- Inherits:
-
Agents::Action
- Object
- Agents::Action
- Agents::Actions::DelegateAction
- Defined in:
- lib/actions/delegate_action.rb
Instance Attribute Summary
Attributes inherited from Agents::Action
#arguments, #description, #examples, #name
Instance Method Summary collapse
-
#initialize(handler:) ⇒ DelegateAction
constructor
A new instance of DelegateAction.
- #perform(request:, args:) ⇒ Object
Methods inherited from Agents::Action
Constructor Details
#initialize(handler:) ⇒ DelegateAction
Returns a new instance of DelegateAction.
4 5 6 7 8 9 10 11 12 |
# File 'lib/actions/delegate_action.rb', line 4 def initialize(handler:) super(name: "delegate", description: "Delegate to another agent", arguments: [ ActionArgument.new(name: "agent", type: "String", description: "The name of the agent to delegate the request to.") ] ) @handler = handler end |
Instance Method Details
#perform(request:, args:) ⇒ Object
14 15 16 |
# File 'lib/actions/delegate_action.rb', line 14 def perform(request:, args:) @handler.delegate_request(request: request, args: args) end |