Module: ChefRunDeck::Config
Overview
> This is the Configuration module.
Instance Method Summary
collapse
define_setting, delete_setting, setup
Instance Method Details
#add(config = {}) ⇒ Object
> Facilitate Dynamic Addition of Configuration Values
> @return [class_variable]
71
72
73
74
75
|
# File 'lib/chef-rundeck/config.rb', line 71
def add(config = {})
config.each do |key, value|
define_setting key.to_sym, value
end
end
|
#clear(config) ⇒ Object
> Facilitate Dynamic Removal of Configuration Values
> @return nil
82
83
84
85
86
|
# File 'lib/chef-rundeck/config.rb', line 82
def clear(config)
Array(config).each do |setting|
delete_setting setting
end
end
|
#options ⇒ Hash
> List the Configurable Keys as a Hash
93
94
95
96
97
98
|
# File 'lib/chef-rundeck/config.rb', line 93
def options
map = ChefRunDeck::Config.class_variables.map do |key|
[key.to_s.tr('@', '').to_sym, class_variable_get(:"#{key}")]
end
Hash[map]
end
|