Module: CloudImagesRunDeck::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]
49
50
51
52
53
|
# File 'lib/cloudimages-rundeck/config.rb', line 49
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
60
61
62
63
64
|
# File 'lib/cloudimages-rundeck/config.rb', line 60
def clear(config)
Array(config).each do |setting|
delete_setting setting
end
end
|
#options ⇒ Hash
> List the Configurable Keys as a Hash
71
72
73
74
75
76
|
# File 'lib/cloudimages-rundeck/config.rb', line 71
def options
map = CloudImagesRunDeck::Config.class_variables.map do |key|
[key.to_s.tr('@', '').to_sym, class_variable_get(:"#{key}")]
end
Hash[map]
end
|