Module Mixlib::Config
In: lib/mixlib/config.rb

Methods

Public Instance methods

Get the value of a configuration option

Parameters

config_option<Symbol>:The configuration option to return

Returns

value:The value of the configuration option

Raises

<ArgumentError>:If the configuration option does not exist

Set the value of a configuration option

Parameters

config_option<Symbol>:The configuration option to set (within the [])
value:The value for the configuration option

Returns

value:The new value of the configuration option

metaprogramming to ensure that the slot for method_symbol gets set to value after any other logic is run

Parameters

method_symbol<Symbol>:Name of the method (variable setter)
blk<Block>:logic block to run in setting slot method_symbol to value
value<Object>:Value to be set in config hash

Pass Mixlib::Config.configure() a block, and it will yield @@configuration.

Parameters

<block>:A block that is sent @@configuration as its argument

Loads a given ruby file, and runs instance_eval against it in the context of the current object.

Raises an IOError if the file cannot be found, or is not readable.

Parameters

<string>:A filename to read from

Check if Mixlib::Config has a configuration option.

Parameters

key<Symbol>:The configuration option to check for

Returns

<True>:If the configuration option exists
<False>:If the configuration option does not exist

Creates a shallow copy of the internal hash

Returns

result of Hash#dup

Return the set of config hash keys

Returns

result of Hash#keys

Merge an incoming hash with our config options

Parameters

hash<Hash>:The incoming hash

Returns

result of Hash#merge!

Allows for simple lookups and setting of configuration options via method calls on Mixlib::Config. If there any arguments to the method, they are used to set the value of the configuration option. Otherwise, it‘s a simple get operation.

Parameters

method_symbol<Symbol>:The method called. Must match a configuration option.
*args:Any arguments passed to the method

Returns

value:The value of the configuration option.

Raises

<ArgumentError>:If the method_symbol does not match a configuration option.

Protected Instance methods

Internal dispatch setter, calling either the real defined method or setting the hash value directly

Parameters

method_symbol<Symbol>:Name of the method (variable setter)
value<Object>:Value to be set in config hash

[Validate]