Class: VSM::Meta::Tools::SummarizeSelf

Inherits:
Base show all
Defined in:
lib/vsm/meta/tools.rb

Instance Attribute Summary

Attributes inherited from Base

#draft_store, #root, #snapshot_cache

Attributes inherited from ToolCapsule

#governance

Instance Method Summary collapse

Methods inherited from Base

#execution_mode, #initialize

Methods included from ActsAsTool

included, #tool_descriptor

Constructor Details

This class inherits a constructor from VSM::Meta::Tools::Base

Instance Method Details

#run(_args) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/vsm/meta/tools.rb', line 135

def run(_args)
  data = snapshot
  tools = flatten_tools(data, []).select { _1[:kind] == "tool" }
  {
    capsule: {
      name: data[:name],
      path: data[:path],
      class: data[:class],
      roles: roles_summary(data[:roles])
    },
    stats: {
      total_tools: tools.size,
      tool_names: tools.map { _1.dig(:tool, :name) }
    },
    snapshot: data
  }
end