Module: CloudShaped::Interpolation
- Includes:
- CoreMethods, FunctionMethods
- Included in:
- DSL
- Defined in:
- lib/cloud_shaped/interpolation.rb
Constant Summary collapse
- DEFAULT_DELIMITERS =
['{{','}}']
Instance Method Summary collapse
-
#interpolate(string, delimiters = DEFAULT_DELIMITERS) ⇒ Object
Interpolates a String, inserting calls to “Ref” and “Fn::GetAtt”.
Methods included from FunctionMethods
Methods included from CoreMethods
#output, #parameter, #ref, #resource, #tag, #tags
Instance Method Details
#interpolate(string, delimiters = DEFAULT_DELIMITERS) ⇒ Object
Interpolates a String, inserting calls to “Ref” and “Fn::GetAtt”.
18 19 20 21 22 23 |
# File 'lib/cloud_shaped/interpolation.rb', line 18 def interpolate(string, delimiters = DEFAULT_DELIMITERS) fragments = string.lines.map do |line| interpolate_line(line, delimiters) end.flatten fn_join('', fragments) end |