Class: RubyLLM::MCP::Configuration::ConfigFile

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/mcp/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ ConfigFile

Returns a new instance of ConfigFile.



161
162
163
# File 'lib/ruby_llm/mcp/configuration.rb', line 161

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



159
160
161
# File 'lib/ruby_llm/mcp/configuration.rb', line 159

def file_path
  @file_path
end

Instance Method Details

#parseObject



165
166
167
168
169
170
171
172
# File 'lib/ruby_llm/mcp/configuration.rb', line 165

def parse
  @parse ||= if @file_path && File.exist?(@file_path)
               config = parse_config_file
               load_mcps_config(config)
             else
               []
             end
end