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:



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

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



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

def delete(path_str) end

#each_entry {|key, value| ... } ⇒ Object #each_entryEnumerator

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.

Overloads:

  • #each_entry {|key, value| ... } ⇒ Object

    Returns the last result of the executed block.

    Yield Parameters:

    • key (String)

      entry key

    • value (Boolean, String, Integer, Float)

      entry value

    Returns:

    • (Object)

      the last result of the executed block

  • #each_entryEnumerator

    Returns enumerator.

    Returns:

    • (Enumerator)

      enumerator



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

def each_entry(*) end

#each_group {|key, value| ... } ⇒ Object #each_groupEnumerator

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.

Overloads:

  • #each_group {|key, value| ... } ⇒ Object

    Returns the last result of the executed block.

    Yield Parameters:

    Returns:

    • (Object)

      the last result of the executed block

  • #each_groupEnumerator

    Returns enumerator.

    Returns:

    • (Enumerator)

      enumerator



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

def each_group(*) end

#get(key) ⇒ Boolean, ...

Returns a value for an entry at the current object identified by key.

Parameters:

  • key (String)

    entry key

Returns:



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

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



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

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



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

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



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

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



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

def number_of_groups(recurse=false) end

#parentWx::Config, ...

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

Returns:



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

def parent; end

#pathArray<String>

Returns the path segment array for the current configuration object.

Returns:

  • (Array<String>)

    path array



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

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:



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

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



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

def rename(old_key, new_key) end

#rootWx::Config

Returns the root (Wx::Config) object

Returns:



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

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)


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

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:



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

def set(key, val) end

#to_hHash

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

Returns:

  • (Hash)


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

def to_h; end

#to_sString

Returns the path string for the current configuration object.

Returns:

  • (String)


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

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:



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

def write(path_str, val) end