Class: AgentSettings::Location
- Inherits:
-
Data
- Object
- Data
- AgentSettings::Location
- Defined in:
- lib/agent_settings/location.rb
Overview
Represents a config file location for an agent.
A Location describes where a configuration file is (or would be) stored, whether it exists, and whether it's the currently active configuration. Locations are organized by scope (global vs project) and source (user, system, file, etc.).
Instance Attribute Summary collapse
-
#active ⇒ Boolean
readonly
whether this is the currently effective config location.
-
#agent ⇒ Symbol
readonly
the agent this location belongs to (:claude, :opencode, :codex).
-
#exists ⇒ Boolean
readonly
whether the config file exists at this path.
-
#note ⇒ String?
readonly
optional note about this location.
-
#path ⇒ String
readonly
the absolute file path to the config file.
-
#scope ⇒ Symbol
readonly
the scope of this location (:global, :project, :managed, :system, :env).
-
#source ⇒ String
readonly
where this location comes from ('user', 'system', 'file', 'local').
Instance Method Summary collapse
-
#active? ⇒ Boolean
Whether this is the currently effective config location.
-
#exists? ⇒ Boolean
Whether the config file exists at this path.
Instance Attribute Details
#active ⇒ Boolean (readonly)
whether this is the currently effective config location
31 32 33 |
# File 'lib/agent_settings/location.rb', line 31 def active @active end |
#agent ⇒ Symbol (readonly)
the agent this location belongs to (:claude, :opencode, :codex)
31 32 33 |
# File 'lib/agent_settings/location.rb', line 31 def agent @agent end |
#exists ⇒ Boolean (readonly)
whether the config file exists at this path
31 32 33 |
# File 'lib/agent_settings/location.rb', line 31 def exists @exists end |
#note ⇒ String? (readonly)
optional note about this location
31 32 33 |
# File 'lib/agent_settings/location.rb', line 31 def note @note end |
#path ⇒ String (readonly)
the absolute file path to the config file
31 32 33 |
# File 'lib/agent_settings/location.rb', line 31 def path @path end |
#scope ⇒ Symbol (readonly)
the scope of this location (:global, :project, :managed, :system, :env)
31 32 33 |
# File 'lib/agent_settings/location.rb', line 31 def scope @scope end |
#source ⇒ String (readonly)
where this location comes from ('user', 'system', 'file', 'local')
31 32 33 |
# File 'lib/agent_settings/location.rb', line 31 def source @source end |
Instance Method Details
#active? ⇒ Boolean
Returns whether this is the currently effective config location.
36 |
# File 'lib/agent_settings/location.rb', line 36 def active? = active |
#exists? ⇒ Boolean
Returns whether the config file exists at this path.
33 |
# File 'lib/agent_settings/location.rb', line 33 def exists? = exists |