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")
Source

Class methods

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

Singleton access

Source

Instance methods

clear

Clear all configuration

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

Get configuration value as string

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

Get configuration value as specific types

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

Check if key exists

Source
keys

Get all keys

Source
load_config

Load configuration from file

Source
save(filepath : String)

Save configuration to file

Source
set(key : String, value : String)

Set configuration value

Source
set(key : String, value)
Source
to_h

Get configuration as hash

Source

Nested types