Module: ForemanDeployments::Config

Defined in:
app/lib/foreman_deployments/config.rb,
app/lib/foreman_deployments/config/hash.rb,
app/lib/foreman_deployments/config/array.rb,
app/lib/foreman_deployments/config/configurator.rb,
app/lib/foreman_deployments/config/load_visitor.rb,
app/lib/foreman_deployments/config/save_visitor.rb,
app/lib/foreman_deployments/config/merge_visitor.rb

Defined Under Namespace

Classes: Array, Configurator, Hash, InvalidValueException, LoadVisitor, MergeVisitor, SaveVisitor

Class Method Summary collapse

Class Method Details

.cast_to_configuration(value) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'app/lib/foreman_deployments/config.rb', line 5

def self.cast_to_configuration(value)
  case value
  when ::Hash
    ForemanDeployments::Config::Hash[value.map { |key, obj| [key, cast_to_configuration(obj)] }]
  when ::Array
    ForemanDeployments::Config::Array[*value.map { |obj| cast_to_configuration(obj) }]
  else
    value
  end
end