Class: Reviewer::Capabilities
- Inherits:
-
Object
- Object
- Reviewer::Capabilities
- Defined in:
- lib/reviewer/capabilities.rb
Overview
Provides machine-readable output describing available tools and usage patterns. Designed for AI agents and automation tools to discover and use Reviewer correctly.
Constant Summary collapse
- KEYWORDS =
{ staged: 'Files staged for commit', unstaged: 'Files with unstaged changes', modified: 'All changed files', untracked: 'New files not yet tracked' }.freeze
- SCENARIOS =
{ before_commit: 'rvw staged', during_development: 'rvw modified', full_review: 'rvw' }.freeze
Instance Attribute Summary collapse
-
#tools ⇒ Object
readonly
Returns the value of attribute tools.
Instance Method Summary collapse
-
#initialize(tools:) ⇒ Capabilities
constructor
Creates a capabilities report for machine-readable tool discovery.
-
#to_h ⇒ Hash
Convert capabilities to a hash representation.
-
#to_json(*_args) ⇒ String
Convert capabilities to formatted JSON string.
Constructor Details
#initialize(tools:) ⇒ Capabilities
Creates a capabilities report for machine-readable tool discovery
18 19 20 |
# File 'lib/reviewer/capabilities.rb', line 18 def initialize(tools:) @tools = tools end |
Instance Attribute Details
#tools ⇒ Object (readonly)
Returns the value of attribute tools.
12 13 14 |
# File 'lib/reviewer/capabilities.rb', line 12 def tools @tools end |
Instance Method Details
#to_h ⇒ Hash
Convert capabilities to a hash representation
38 39 40 41 42 43 44 45 |
# File 'lib/reviewer/capabilities.rb', line 38 def to_h { version: VERSION, tools: tools_data, keywords: KEYWORDS, scenarios: SCENARIOS } end |
#to_json(*_args) ⇒ String
Convert capabilities to formatted JSON string
50 51 52 |
# File 'lib/reviewer/capabilities.rb', line 50 def to_json(*_args) JSON.pretty_generate(to_h) end |