Module: GithubRunDeck::Config

Extended by:
Configuration
Defined in:
lib/github-rundeck/config.rb

Overview

> This is the Configuration module.

Class Method Summary collapse

Methods included from Configuration

define_setting, delete_setting, setup

Class Method Details

.add(config = {}) ⇒ Object

> Facilitate Dynamic Addition of Configuration Values

> @return [class_variable]



49
50
51
52
53
# File 'lib/github-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/github-rundeck/config.rb', line 60

def clear(config)
  Array(config).each do |setting|
    delete_setting setting
  end
end

.optionsHash

> List the Configurable Keys as a Hash

Returns:

  • (Hash)


71
72
73
74
75
76
# File 'lib/github-rundeck/config.rb', line 71

def options
  map = Config.class_variables.map do |key|
    [key.to_s.tr('@', '').to_sym, class_variable_get(:"#{key}")]
  end
  Hash[map]
end