Class: Grntest::TemplateEvaluator
- Inherits:
-
Object
- Object
- Grntest::TemplateEvaluator
- Defined in:
- lib/grntest/template-evaluator.rb
Instance Method Summary collapse
- #evaluate(**local_variables) ⇒ Object
-
#initialize(template) ⇒ TemplateEvaluator
constructor
A new instance of TemplateEvaluator.
Constructor Details
#initialize(template) ⇒ TemplateEvaluator
Returns a new instance of TemplateEvaluator.
18 19 20 |
# File 'lib/grntest/template-evaluator.rb', line 18 def initialize(template) @template = template end |
Instance Method Details
#evaluate(**local_variables) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/grntest/template-evaluator.rb', line 22 def evaluate(**local_variables) _binding = binding local_variables.each do |name, value| _binding.local_variable_set(name, value) end _binding.eval(@template) end |