class

CogUtil::Config

Inherits Reference < Object

Configuration manager for OpenCog Supports YAML, JSON, and simple key=value format files

Constructors

new(config_filename : String = "opencog.conf")

Class methods

create_instance(filename : String = "opencog.conf")
instance

Singleton access

Instance methods

clear

Clear all configuration

get(key : String, default : String = "") : String

Get configuration value as string

get_bool(key : String, default : Bool = false) : Bool

Get configuration value as specific types

get_float(key : String, default : Float64 = 0.0) : Float64
get_int(key : String, default : Int32 = 0) : Int32
has?(key : String) : Bool

Check if key exists

keys

Get all keys

load_config

Load configuration from file

save(filepath : String)

Save configuration to file

set(key : String, value : String)

Set configuration value

set(key : String, value)
to_h

Get configuration as hash

Nested types