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.
14 15 16 17 |
# File 'lib/env_setup/env_builder.rb', line 14 def initialize(inputs) @inputs = inputs @vars = {} end |
Instance Attribute Details
#inputs ⇒ Object
Returns the value of attribute inputs.
12 13 14 |
# File 'lib/env_setup/env_builder.rb', line 12 def inputs @inputs end |
#vars ⇒ Object
Returns the value of attribute vars.
12 13 14 |
# File 'lib/env_setup/env_builder.rb', line 12 def vars @vars end |
Instance Method Details
#build_json ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/env_setup/env_builder.rb', line 19 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
27 28 29 30 31 |
# File 'lib/env_setup/env_builder.rb', line 27 def build_var(var_template) return var_template unless var_template.is_a?(Hash) var_builder(var_template.transform_keys!(&:to_s)).call end |