Class: EnvSetup::EnvBuilder
- Inherits:
-
Object
- Object
- EnvSetup::EnvBuilder
- Defined in:
- lib/env_setup/env_builder.rb
Instance Attribute Summary collapse
-
#inputs ⇒ Object
Returns the value of attribute inputs.
-
#vars ⇒ Object
Returns the value of attribute vars.
Instance Method Summary collapse
- #build_json ⇒ Object
- #build_var(var_template) ⇒ Object
-
#initialize(inputs) ⇒ EnvBuilder
constructor
A new instance of EnvBuilder.
Constructor Details
#initialize(inputs) ⇒ EnvBuilder
Returns a new instance of EnvBuilder.
15 16 17 18 |
# File 'lib/env_setup/env_builder.rb', line 15 def initialize(inputs) @inputs = inputs @vars = {} end |
Instance Attribute Details
#inputs ⇒ Object
Returns the value of attribute inputs.
13 14 15 |
# File 'lib/env_setup/env_builder.rb', line 13 def inputs @inputs end |
#vars ⇒ Object
Returns the value of attribute vars.
13 14 15 |
# File 'lib/env_setup/env_builder.rb', line 13 def vars @vars end |
Instance Method Details
#build_json ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/env_setup/env_builder.rb', line 20 def build_json secrets = aws_secrets configuration.template.merge(secrets).each do |key, var_template| vars[key.to_s] = build_var(var_template) end vars end |
#build_var(var_template) ⇒ Object
28 29 30 31 32 |
# File 'lib/env_setup/env_builder.rb', line 28 def build_var(var_template) return var_template unless var_template.is_a?(Hash) var_builder(var_template.transform_keys!(&:to_s)).call end |