Module: DeployInfo::Config

Extended by:
Configuration, Config
Included in:
Config
Defined in:
lib/deploy-info/config.rb

Overview

> This is the Configuration module.

Instance Method Summary collapse

Methods included from Configuration

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

#optionsHash

> List the Configurable Keys as a Hash

Returns:

  • (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