Module: PangeaModule
- Includes:
- PangeaBase
- Defined in:
- lib/pangea-orchestrator/modules.rb
Constant Summary collapse
Constants included from PangeaBase
Class Method Summary collapse
-
.process(mod) ⇒ Object
entrypoint for module processing.
- .symbolize(hash) ⇒ Object
- .terraform_synth ⇒ Object
Class Method Details
.process(mod) ⇒ Object
entrypoint for module processing
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/pangea-orchestrator/modules.rb', line 115 def process(mod) mod = symbolize(mod) name = mod.fetch(:name) data = mod.fetch(:data, {}) raise ArgumentError, %(name cannot be nil) if name.nil? # understanding that module entrypoint loading # will work with #{context}-#{name} context = mod.fetch(:context, %(pangea-component)) require_name = %(#{context}-#{name}) require require_name render(data) end |
.symbolize(hash) ⇒ Object
106 107 108 |
# File 'lib/pangea-orchestrator/modules.rb', line 106 def symbolize(hash) JSON[JSON[hash], symbolize_names: true] end |
.terraform_synth ⇒ Object
110 111 112 |
# File 'lib/pangea-orchestrator/modules.rb', line 110 def terraform_synth @terraform_synth ||= TerraformSynthesizer.new end |