Class: Vercon::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vercon/config.rb

Constant Summary collapse

CLAUDE_MODELS =
%w[
  claude-3-haiku-20240307
  claude-3-sonnet-20240229
  claude-3-opus-20240229
].freeze
DEFAULT_CLAUDE_MODEL =
"claude-3-sonnet-20240229"
LOWEST_CLAUDE_MODEL =
"claude-3-haiku-20240307"
PATH =
"~/.vercon.yml"

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



17
18
19
20
21
22
# File 'lib/vercon/config.rb', line 17

def initialize
  @files = Dry::Files.new
  @config = YAML.load_file(@files.expand_path(PATH))
rescue Errno::ENOENT
  @config = {}
end

Instance Method Details

#claude_modelObject



32
33
34
# File 'lib/vercon/config.rb', line 32

def claude_model
  @config["claude_model"]
end

#claude_tokenObject



28
29
30
# File 'lib/vercon/config.rb', line 28

def claude_token
  @config["claude_token"]
end

#exists?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/vercon/config.rb', line 24

def exists?
  !@config.empty?
end

#open_by_default?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/vercon/config.rb', line 36

def open_by_default?
  @config["open_by_default"].nil? ? false : @config["open_by_default"]
end