Module: Wx::ConfigBase::Interface
- Included in:
- Wx::Config, Wx::Config::Group, Wx::ConfigWx, Wx::ConfigWx::Group
- Defined in:
- lib/wx/doc/config.rb
Overview
Common configuration access methods for either the root object or any nested group objects.
Instance Method Summary collapse
-
#[](path_str) ⇒ Boolean, ...
Returns a value for an entry from the configuration identified by
path_str
. -
#delete(path_str) ⇒ Boolean, ...
Removes the entry identified by
path_str
if it exists and returns it’s value. -
#each_entry {|key, value| ... } ⇒ Object, Enumerator
Iterate all value entries at the current object (no recursion).
-
#each_group {|key, value| ... } ⇒ Object, Enumerator
Iterate all group entries at the current object (no recursion).
-
#get(key) ⇒ Boolean, ...
Returns a value for an entry at the current object identified by
key
. -
#has_entry?(path_str) ⇒ Boolean
Returns if a value entry exists matching the given path string.
-
#has_group?(path_str) ⇒ Boolean
Returns if a group entry exists matching the given path string.
-
#number_of_entries(recurse = false) ⇒ Integer
Returns the total number of value entries at the current object only (if recurse is false) or including any nested groups (if recurse is true).
-
#number_of_groups(recurse = false) ⇒ Integer
Returns the total number of group entries at the current object only (if recurse is false) or including any nested groups (if recurse is true).
-
#parent ⇒ Wx::Config, ...
Returns the parent configuration object or nil if this for the root object.
-
#path ⇒ Array<String>
Returns the path segment array for the current configuration object.
-
#read(path_str, output = nil) ⇒ Boolean, ...
Returns a value for an entry from the configuration identified by
path_str
. -
#rename(old_key, new_key) ⇒ Boolean
Changes key for the entry at the current object identified by
old_key
tonew_key
if it exists. -
#root ⇒ Wx::Config
Returns the root (Wx::Config) object.
-
#root? ⇒ Boolean
Returns true if the current configuration object is the root (Wx::Config) object, false otherwise (for Wx::Config::Group objects).
-
#set(key, val) ⇒ Boolean, ...
Sets a value for an entry at the current object identified by
key
or deletes the entry ifval
is nil. -
#to_h ⇒ Hash
Returns the Hash object used to store the settings for the current configuration object.
-
#to_s ⇒ String
Returns the path string for the current configuration object.
-
#write(path_str, val) ⇒ Boolean, ...
(also: #[]=)
Sets a value for an entry from the configuration identified by
path_str
or deletes the entry ifval
is nil.
Instance Method Details
#[](path_str) ⇒ Boolean, ...
Returns a value for an entry from the configuration identified by path_str
. Provides arbitrary access though the entire configuration using absolute or relative paths.
124 |
# File 'lib/wx/doc/config.rb', line 124 def [](path_str) end |
#delete(path_str) ⇒ Boolean, ...
Removes the entry identified by path_str
if it exists and returns it’s value.
102 |
# File 'lib/wx/doc/config.rb', line 102 def delete(path_str) end |
#each_entry {|key, value| ... } ⇒ Object, Enumerator
Iterate all value entries at the current object (no recursion). Passes key/value pairs to the given block or returns an Enumerator is no block given.
51 |
# File 'lib/wx/doc/config.rb', line 51 def each_entry(&block) end |
#each_group {|key, value| ... } ⇒ Object, Enumerator
Iterate all group entries at the current object (no recursion). Passes key/value pairs to the given block or returns an Enumerator is no block given.
58 |
# File 'lib/wx/doc/config.rb', line 58 def each_group(&block) end |
#get(key) ⇒ Boolean, ...
Returns a value for an entry at the current object identified by key
.
89 |
# File 'lib/wx/doc/config.rb', line 89 def get(key) end |
#has_entry?(path_str) ⇒ Boolean
Returns if a value entry exists matching the given path string. Path strings can be absolute (starting with SEPARATOR) or relative to the current object and can have relative segments embedded (‘.’ and ‘..’ are supported).
77 |
# File 'lib/wx/doc/config.rb', line 77 def has_entry?(path_str) end |
#has_group?(path_str) ⇒ Boolean
Returns if a group entry exists matching the given path string. Path strings can be absolute (starting with SEPARATOR) or relative to the current object and can have relative segments embedded (‘.’ and ‘..’ are supported).
84 |
# File 'lib/wx/doc/config.rb', line 84 def has_group?(path_str) end |
#number_of_entries(recurse = false) ⇒ Integer
Returns the total number of value entries at the current object only (if recurse is false) or including any nested groups (if recurse is true)
64 |
# File 'lib/wx/doc/config.rb', line 64 def number_of_entries(recurse=false) end |
#number_of_groups(recurse = false) ⇒ Integer
Returns the total number of group entries at the current object only (if recurse is false) or including any nested groups (if recurse is true)
70 |
# File 'lib/wx/doc/config.rb', line 70 def number_of_groups(recurse=false) end |
#parent ⇒ Wx::Config, ...
Returns the parent configuration object or nil if this for the root object.
158 |
# File 'lib/wx/doc/config.rb', line 158 def parent; end |
#path ⇒ Array<String>
Returns the path segment array for the current configuration object.
154 |
# File 'lib/wx/doc/config.rb', line 154 def path; end |
#read(path_str, output = nil) ⇒ Boolean, ...
Returns a value for an entry from the configuration identified by path_str
. Provides arbitrary access though the entire configuration using absolute or relative paths. Supports coercing configuration values to a specified output type (Integer,Float,String,TrueClass,FalseClass). By default returns un-coerced value. Raises exception if incompatible coercion is specified.
118 |
# File 'lib/wx/doc/config.rb', line 118 def read(path_str, output=nil) end |
#rename(old_key, new_key) ⇒ Boolean
Changes key for the entry at the current object identified by old_key
to new_key
if it exists.
108 |
# File 'lib/wx/doc/config.rb', line 108 def rename(old_key, new_key) end |
#root ⇒ Wx::Config
Returns the root (Wx::Config) object
150 |
# File 'lib/wx/doc/config.rb', line 150 def root; end |
#root? ⇒ Boolean
Returns true if the current configuration object is the root (Wx::Config) object, false otherwise (for Wx::Config::Group objects).
146 |
# File 'lib/wx/doc/config.rb', line 146 def root?; end |
#set(key, val) ⇒ Boolean, ...
Sets a value for an entry at the current object identified by key
or deletes the entry if val
is nil. Returns the new value for the entry. Group entries can be set using Hash values (entry values in the hash will be sanitized).
97 |
# File 'lib/wx/doc/config.rb', line 97 def set(key, val) end |
#to_h ⇒ Hash
Returns the Hash object used to store the settings for the current configuration object.
141 |
# File 'lib/wx/doc/config.rb', line 141 def to_h; end |
#to_s ⇒ String
Returns the path string for the current configuration object.
137 |
# File 'lib/wx/doc/config.rb', line 137 def to_s; end |
#write(path_str, val) ⇒ Boolean, ... Also known as: []=
Sets a value for an entry from the configuration identified by path_str
or deletes the entry if val
is nil. Returns the new value for the entry. Group entries can be set using Hash values (entry values in the hash will be sanitized).
132 |
# File 'lib/wx/doc/config.rb', line 132 def write(path_str, val) end |