Class: Wx::Config
- Inherits:
-
ConfigBase
- Object
- ConfigBase
- Wx::Config
- Includes:
- Wx::ConfigBase::Interface
- Defined in:
- lib/wx/doc/config.rb
Overview
Configuration class for wxRuby which stores it’s settings in a (possibly nested) Hash. This way configurations can be easily persisted using any commonly used Ruby methods like YAML or JSON files.
Wx::Config supports Boolean (true or false), Integer, Float and String values and nested groups (essentially nested hashes). Any entry values set will be sanitized to match the supported types, i.e. if the value matches a supported type the value is accepted unaltered otherwise Integer (to_int
), Float (to_f
) or String (to_s
) coercion are applied (in that order). Hash values are installed as nested groups.
Like the C++ wxConfigBase derivatives Wx::Config supports arbitrary access using path strings which support absolute paths (‘/xxxx’) and relative paths (‘xxx/xxx’, ‘../xxx’, ‘./xxxx’). Relative segments can also be embedded in the path strings (‘/aaa/bbb/../ccc’).
Defined Under Namespace
Classes: Group
Constant Summary
Constants inherited from ConfigBase
Instance Method Summary collapse
-
#clear ⇒ true
Deletes all configuration content and returns if successful.
-
#initialize(hash = nil) ⇒ Wx::Config
constructor
Constructor.
-
#is_expanding_env_vars ⇒ Boolean
(also: #expanding_env_vars?)
Returns true if we are expanding environment variables in string values, false otherwise.
-
#replace(hash) ⇒ self
Replaces the configuration content with the content of the provided Hash.
-
#set_expand_env_vars(flag) ⇒ Object
(also: #expand_env_vars)
Determine whether we wish to expand environment variables in string values.
Methods included from Wx::ConfigBase::Interface
#[], #delete, #each_entry, #each_group, #get, #has_entry?, #has_group?, #number_of_entries, #number_of_groups, #parent, #path, #read, #rename, #root, #root?, #set, #to_h, #to_s, #write
Methods inherited from ConfigBase
Constructor Details
#initialize(hash = nil) ⇒ Wx::Config
Constructor.
226 |
# File 'lib/wx/doc/config.rb', line 226 def initialize(hash = nil)end |
Instance Method Details
#clear ⇒ true
Deletes all configuration content and returns if successful.
230 |
# File 'lib/wx/doc/config.rb', line 230 def clear; end |
#is_expanding_env_vars ⇒ Boolean Also known as: expanding_env_vars?
Returns true if we are expanding environment variables in string values, false otherwise.
240 |
# File 'lib/wx/doc/config.rb', line 240 def ; end |
#replace(hash) ⇒ self
Replaces the configuration content with the content of the provided Hash. Values will be sanitized (see Wx::Config).
236 |
# File 'lib/wx/doc/config.rb', line 236 def replace(hash) end |
#set_expand_env_vars(flag) ⇒ Object Also known as: expand_env_vars
Determine whether we wish to expand environment variables in string values.
245 |
# File 'lib/wx/doc/config.rb', line 245 def (flag) end |