Class: CloudFormula::JsonErb
- Inherits:
-
ERB
- Object
- ERB
- CloudFormula::JsonErb
- Defined in:
- lib/cloudformula/json_erb.rb
Overview
Custom ERB compiler which causes variable interpolation inside <%= %> to be json encoded. Inside regular <% %>, the variables are used without json encoding.
CloudFormation stack options defaults can be set directly within a template by setting @stack_options. See README.md “CloudFormation stack options” for details.
Basic validation functionality is possible by setting @validations. See README.md “Validations” for details
Defined Under Namespace
Classes: CompilerWithBlock
Instance Method Summary collapse
- #make_compiler(*args) ⇒ Object
-
#stack_options(b = new_toplevel) ⇒ Hash
Returns the @stack_options value set within the template.
-
#validations(b = new_toplevel) ⇒ Hash
Returns the @validations value set within the template.
Instance Method Details
#make_compiler(*args) ⇒ Object
20 21 22 |
# File 'lib/cloudformula/json_erb.rb', line 20 def make_compiler(*args) CompilerWithBlock.new *args end |
#stack_options(b = new_toplevel) ⇒ Hash
Returns the @stack_options value set within the template.
28 29 30 31 |
# File 'lib/cloudformula/json_erb.rb', line 28 def (b = new_toplevel) result(b) b.eval('@stack_options') || {} end |
#validations(b = new_toplevel) ⇒ Hash
Returns the @validations value set within the template.
37 38 39 40 |
# File 'lib/cloudformula/json_erb.rb', line 37 def validations(b = new_toplevel) result(b) b.eval('@validations') || {} end |