Module: Kelbim::TemplateHelper
- Included in:
- DSL, DSL::EC2, DSL::EC2::LoadBalancer, DSL::EC2::LoadBalancer::Attributes, DSL::EC2::LoadBalancer::HealthCheck, DSL::EC2::LoadBalancer::Listeners, DSL::EC2::LoadBalancer::Listeners::Listener
- Defined in:
- lib/kelbim/template_helper.rb
Instance Method Summary collapse
Instance Method Details
#context ⇒ Object
16 17 18 |
# File 'lib/kelbim/template_helper.rb', line 16 def context @context end |
#include_template(template_name, context = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/kelbim/template_helper.rb', line 3 def include_template(template_name, context = {}) tmplt = @context.templates[template_name.to_s] unless tmplt raise "Template `#{template_name}` is not defined" end context_orig = @context @context = @context.merge(context) instance_eval(&tmplt) @context = context_orig end |