Skip to content

📦 SQA::Config

Description

Configuration class for SQA settings. Extends Hashie::Dash for property-based configuration with coercion.

Source Information

Defined in: lib/sqa/config.rb:54

Inherits from: Hashie::Dash

🏭 Class Methods

.reset()

Resets the configuration to default values. Creates a new Config instance and assigns it to SQA.config.

Returns

Type: SQA::Config

The new config instance

Source Location

lib/sqa/config.rb:255


.initialized?()

Returns whether the configuration has been initialized.

Returns

Type: Boolean

true if reset has been called

Source Location

lib/sqa/config.rb:263


🔨 Instance Methods

#command()

Returns

Type: String, nil

Current command (nil, 'analysis', or 'web')

Source Location

lib/sqa/config.rb:54


#command=(value)

Returns

Type: String, nil

Current command (nil, 'analysis', or 'web')

Source Location

lib/sqa/config.rb:54


#config_file()

Returns

Type: String, nil

Path to configuration file

Source Location

lib/sqa/config.rb:54


#config_file=(value)

Returns

Type: String, nil

Path to configuration file

Source Location

lib/sqa/config.rb:54


#dump_config()

Returns

Type: String, nil

Path to dump current configuration

Source Location

lib/sqa/config.rb:54


#dump_config=(value)

Returns

Type: String, nil

Path to dump current configuration

Source Location

lib/sqa/config.rb:54


#data_dir()

Returns

Type: String

Directory for data storage (default: ~/sqa_data)

Source Location

lib/sqa/config.rb:54


#data_dir=(value)

Returns

Type: String

Directory for data storage (default: ~/sqa_data)

Source Location

lib/sqa/config.rb:54


#portfolio_filename()

Returns

Type: String

Portfolio CSV filename (default: portfolio.csv)

Source Location

lib/sqa/config.rb:54


#portfolio_filename=(value)

Returns

Type: String

Portfolio CSV filename (default: portfolio.csv)

Source Location

lib/sqa/config.rb:54


#trades_filename()

Returns

Type: String

Trades CSV filename (default: trades.csv)

Source Location

lib/sqa/config.rb:54


#trades_filename=(value)

Returns

Type: String

Trades CSV filename (default: trades.csv)

Source Location

lib/sqa/config.rb:54


#log_level()

Returns

Type: Symbol

Log level (:debug, :info, :warn, :error, :fatal)

Source Location

lib/sqa/config.rb:54


#log_level=(value)

Returns

Type: Symbol

Log level (:debug, :info, :warn, :error, :fatal)

Source Location

lib/sqa/config.rb:54


#debug()

Returns

Type: Boolean

Enable debug mode

Source Location

lib/sqa/config.rb:54


#debug=(value)

Returns

Type: Boolean

Enable debug mode

Source Location

lib/sqa/config.rb:54


#verbose()

Returns

Type: Boolean

Enable verbose output

Source Location

lib/sqa/config.rb:54


#verbose=(value)

Returns

Type: Boolean

Enable verbose output

Source Location

lib/sqa/config.rb:54


#plotting_library()

Returns

Type: Symbol

Plotting library to use (:gruff)

Source Location

lib/sqa/config.rb:54


#plotting_library=(value)

Returns

Type: Symbol

Plotting library to use (:gruff)

Source Location

lib/sqa/config.rb:54


#lazy_update()

Returns

Type: Boolean

Skip API updates if cached data exists

Source Location

lib/sqa/config.rb:54


#lazy_update=(value)

Returns

Type: Boolean

Skip API updates if cached data exists

Source Location

lib/sqa/config.rb:54


#initialize(a_hash = {})

Creates a new Config instance with optional initial values. Automatically applies environment variable overrides.

Parameters

Name Type Description
a_hash Hash Initial configuration values

Returns

Type: Config

a new instance of Config

Source Location

lib/sqa/config.rb:120


#debug?()

Returns whether debug mode is enabled.

Returns

Type: Boolean

true if debug mode is on

Source Location

lib/sqa/config.rb:127


#verbose?()

Returns whether verbose mode is enabled.

Returns

Type: Boolean

true if verbose mode is on

Source Location

lib/sqa/config.rb:131


#from_file()

Loads configuration from a file. Supports YAML (.yml, .yaml), TOML (.toml), and JSON (.json) formats.

Returns

Type: void

Source Location

lib/sqa/config.rb:141


#dump_file()

Writes current configuration to a file. Format is determined by file extension.

Returns

Type: void

Source Location

lib/sqa/config.rb:178


#inject_additional_properties()

Injects additional properties from plugins. Allows external code to register new configuration options.

Returns

Type: void

Source Location

lib/sqa/config.rb:206


📝 Attributes

🔄 command read/write

🔄 config_file read/write

🔄 dump_config read/write

🔄 data_dir read/write

🔄 portfolio_filename read/write

🔄 trades_filename read/write

🔄 log_level read/write

🔄 debug read/write

🔄 verbose read/write

🔄 plotting_library read/write

🔄 lazy_update read/write