Module: RubyPi::Tool
- Defined in:
- lib/ruby_pi/tools/definition.rb
Overview
Top-level convenience module for defining tools with a short syntax.
Usage:
tool = RubyPi::Tool.define(name: "my_tool", description: "Does stuff") { |args| ... }
Class Method Summary collapse
-
.define(name:, description:, category: nil, parameters: {}, &block) ⇒ RubyPi::Tools::Definition
Creates a new tool Definition using the same arguments as Definition.new.
Class Method Details
.define(name:, description:, category: nil, parameters: {}, &block) ⇒ RubyPi::Tools::Definition
Creates a new tool Definition using the same arguments as Definition.new.
This is the primary public API for defining tools. It provides a cleaner entry point than instantiating Definition directly.
138 139 140 141 142 143 144 145 146 |
# File 'lib/ruby_pi/tools/definition.rb', line 138 def define(name:, description:, category: nil, parameters: {}, &block) Tools::Definition.new( name: name, description: description, category: category, parameters: parameters, &block ) end |