Module: CloudShaped::Interpolation
- Includes:
- CoreMethods, FunctionMethods
- Included in:
- DSL
- Defined in:
- lib/cloud_shaped/interpolation.rb
Constant Summary collapse
- DEFAULT_DELIMITERS =
["{{", "}}"].freeze
Instance Method Summary collapse
-
#interpolate(string, delimiters = DEFAULT_DELIMITERS) ⇒ Object
Interpolates a String, inserting calls to “Ref” and “Fn::GetAtt”.
Methods included from FunctionMethods
#fn_and, #fn_base64, #fn_equals, #fn_if, #fn_join, #fn_not, #fn_or
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) interpolated_lines = string.split("\n", -1).map do |line| interpolate_line(line, delimiters) end join("\n", interpolated_lines) end |