Module: DeployInfo::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]
54
55
56
57
58
|
# File 'lib/deploy-info/config.rb', line 54
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
65
66
67
68
69
|
# File 'lib/deploy-info/config.rb', line 65
def clear(config)
Array(config).each do |setting|
delete_setting setting
end
end
|
#options ⇒ Hash
> List the Configurable Keys as a Hash
76
77
78
79
80
81
|
# File 'lib/deploy-info/config.rb', line 76
def options
map = DeployInfo::Config.class_variables.map do |key|
[key.to_s.tr('@', '').to_sym, class_variable_get(:"#{key}")]
end
Hash[map]
end
|