Class ParseConfig
In: lib/parseconfig.rb
Parent: Object

Note: A group is a set of parameters defined for a subpart of a config file

Methods

Constants

Version = '0.5.2'

Attributes

config_file  [RW] 
groups  [RW] 
params  [RW] 

Public Class methods

Initialize the class with the path to the ‘config_file’ The class objects are dynamically generated by the name of the ‘param’ in the config file. Therefore, if the config file is ‘param = value’ then the itializer will eval "@param = value"

Public Instance methods

This method adds an element to the config object (not the config file) By adding a Hash, you create a new group

Add parameters to a group. Note that parameters with the same name could be placed in different groups

List available sub-groups of the config.

This method returns all parameters/groups defined in a config file.

This method will provide the value held by the object "@param" where "@param" is actually the name of the param in the config file.

DEPRECATED - will be removed in future versions

Import data from the config to our config object.

This method will set the value of ’@param’ to nil (not in the config file, only in the app).

DEPRECATED - will be removed in future versions.

This method is simple. Should you need to override a value dynamically, use override_value(param, value) where ‘param’ is the name of the paramater in the config file.

DEPRECATED - will be removed in future versions.

Validate the config file, and contents

Writes out the config file to output_stream

[Validate]