Class: RailsMcpServer::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-mcp-server/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



14
15
16
17
18
19
20
21
22
# File 'lib/rails-mcp-server/config.rb', line 14

def initialize
  @log_level = Logger::INFO
  @config_dir = get_config_dir
  @current_project = nil
  @active_project_path = nil

  configure_logger
  load_projects
end

Instance Attribute Details

#active_project_pathObject

Returns the value of attribute active_project_path.



5
6
7
# File 'lib/rails-mcp-server/config.rb', line 5

def active_project_path
  @active_project_path
end

#config_dirObject

Returns the value of attribute config_dir.



5
6
7
# File 'lib/rails-mcp-server/config.rb', line 5

def config_dir
  @config_dir
end

#current_projectObject

Returns the value of attribute current_project.



5
6
7
# File 'lib/rails-mcp-server/config.rb', line 5

def current_project
  @current_project
end

#log_levelObject

Returns the value of attribute log_level.



6
7
8
# File 'lib/rails-mcp-server/config.rb', line 6

def log_level
  @log_level
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/rails-mcp-server/config.rb', line 5

def logger
  @logger
end

#projectsObject

Returns the value of attribute projects.



5
6
7
# File 'lib/rails-mcp-server/config.rb', line 5

def projects
  @projects
end

Class Method Details

.setupObject



8
9
10
11
12
# File 'lib/rails-mcp-server/config.rb', line 8

def self.setup
  new.tap do |instance|
    yield(instance) if block_given?
  end
end