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

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.

Parameters:

  • path_str (String)

Returns:

[View source]

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.

Parameters:

  • path_str (String)

    entry path

Returns:

  • (Boolean, String, Integer, Float, Hash, nil)

    entry value

[View source]

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.

Yield Parameters:

  • key (String)

    entry key

  • value (Boolean, String, Integer, Float)

    entry value

Returns:

  • (Object, Enumerator)

    either the last result of the executed block or an enumerator if no block given

[View source]

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.

Yield Parameters:

Returns:

  • (Object, Enumerator)

    either the last result of the executed block or an enumerator if no block given

[View source]

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.

Parameters:

  • key (String)

    entry key

Returns:

[View source]

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).

Parameters:

  • path_str (String)

    entry path

Returns:

  • (Boolean)

    true if entry exists, false otherwise

[View source]

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).

Parameters:

  • path_str (String)

    entry path

Returns:

  • (Boolean)

    true if entry exists, false otherwise

[View source]

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)

Parameters:

  • recurse (Boolean) (defaults to: false)

Returns:

  • (Integer)

    count

[View source]

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)

Parameters:

  • recurse (Boolean) (defaults to: false)

Returns:

  • (Integer)

    count

[View source]

70
# File 'lib/wx/doc/config.rb', line 70

def number_of_groups(recurse=false) end

#parentWx::Config, ...

Returns the parent configuration object or nil if this for the root object.

Returns:

[View source]

158
# File 'lib/wx/doc/config.rb', line 158

def parent; end

#pathArray<String>

Returns the path segment array for the current configuration object.

Returns:

  • (Array<String>)

    path array

[View source]

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.

Parameters:

  • path_str (String)
  • output (Class, Proc, nil) (defaults to: nil)

    output type (or converter proc) to convert to (with)

Returns:

[View source]

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.

Parameters:

  • old_key (String)

    current entry key

  • new_key (String)

    new entry key

Returns:

  • (Boolean)

    true if the entry was renamed, false otherwise

[View source]

108
# File 'lib/wx/doc/config.rb', line 108

def rename(old_key, new_key) end

#rootWx::Config

Returns the root (Wx::Config) object

Returns:

[View source]

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).

Returns:

  • (Boolean)
[View source]

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).

Parameters:

  • key (String)

    entry key

  • val (Boolean, String, Integer, Float, Hash, nil)

    entry value

Returns:

[View source]

97
# File 'lib/wx/doc/config.rb', line 97

def set(key, val) end

#to_hHash

Returns the Hash object used to store the settings for the current configuration object.

Returns:

  • (Hash)
[View source]

141
# File 'lib/wx/doc/config.rb', line 141

def to_h; end

#to_sString

Returns the path string for the current configuration object.

Returns:

  • (String)
[View source]

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).

Parameters:

  • path_str (String)
  • val (Boolean, String, Integer, Float, Hash, nil)

    entry value

Returns:

[View source]

132
# File 'lib/wx/doc/config.rb', line 132

def write(path_str, val) end