Class: OmniAI::Tools::Database::BaseTool
- Inherits:
-
OmniAI::Tool
- Object
- OmniAI::Tool
- OmniAI::Tools::Database::BaseTool
- Defined in:
- lib/omniai/tools/database/base_tool.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
- #execute(statements:) ⇒ Array<Hash>
-
#initialize(logger: Logger.new(IO::NULL)) ⇒ BaseTool
constructor
A new instance of BaseTool.
Constructor Details
#initialize(logger: Logger.new(IO::NULL)) ⇒ BaseTool
Returns a new instance of BaseTool.
13 14 15 16 |
# File 'lib/omniai/tools/database/base_tool.rb', line 13 def initialize(logger: Logger.new(IO::NULL)) super() @logger = logger end |
Instance Method Details
#execute(statements:) ⇒ Array<Hash>
25 26 27 28 29 30 31 32 33 |
# File 'lib/omniai/tools/database/base_tool.rb', line 25 def execute(statements:) [].tap do |executions| statements.map do |statement| execution = perform(statement:) executions << execution break unless execution[:status].eql?(:ok) end end end |