Class: Axn::Tools::VersionGroup
- Inherits:
-
Object
- Object
- Axn::Tools::VersionGroup
- Defined in:
- lib/axn/tools/version_group.rb
Overview
The coexisting versions of ONE logical tool (one (adapter, tool_name)), and the single place
latest resolves — so members' latest-collapse and a per-name lookup consume the same
rules instead of each re-deriving them. Validates the group on construction (the relaxed
replacement for the old unique-tool_name assertion).
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#all ⇒ Object
readonly
Returns the value of attribute all.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
Instance Method Summary collapse
-
#initialize(adapter:, tool_name:, members:) ⇒ VersionGroup
constructor
A new instance of VersionGroup.
-
#latest ⇒ Object
Newest contract.
Constructor Details
#initialize(adapter:, tool_name:, members:) ⇒ VersionGroup
Returns a new instance of VersionGroup.
12 13 14 15 16 17 |
# File 'lib/axn/tools/version_group.rb', line 12 def initialize(adapter:, tool_name:, members:) @adapter = adapter @tool_name = tool_name @all = members.sort_by(&:tool_version) _validate! end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
10 11 12 |
# File 'lib/axn/tools/version_group.rb', line 10 def adapter @adapter end |
#all ⇒ Object (readonly)
Returns the value of attribute all.
10 11 12 |
# File 'lib/axn/tools/version_group.rb', line 10 def all @all end |
#tool_name ⇒ Object (readonly)
Returns the value of attribute tool_name.
10 11 12 |
# File 'lib/axn/tools/version_group.rb', line 10 def tool_name @tool_name end |
Instance Method Details
#latest ⇒ Object
Newest contract. What latest-favoring adapters (MCP, ruby_llm) serve. An adapter that
instead addresses each version explicitly (a path-routing HTTP surface) reads all.
21 22 23 |
# File 'lib/axn/tools/version_group.rb', line 21 def latest @all.max_by(&:tool_version) end |