Method: Jets::Resource::Replacer#replace_placeholders
- Defined in:
- lib/jets/resource/replacer.rb
#replace_placeholders(attributes) ⇒ Object
Replace placeholder hash values with replacements. This does a deep replacement to the hash values. The replacement “key” is the string value within the value.
Example:
attributes = {whatever: "foo REPLACE_KEY bar" }
replace_placeholders(attributes, REPLACE_KEY: "blah:arn")
=> {whatever: "foo blah:arn bar" }
Also, we always replace the special namespace value in the hash values. Example:
attributes = {whatever: "{namespace}LambdaFunction" }
replace_placeholders(attributes, {})
=> {whatever: "foo PostsControllerIndexLambdaFunction bar" }
24 25 26 |
# File 'lib/jets/resource/replacer.rb', line 24 def replace_placeholders(attributes) update_values(attributes) end |