Class: Simmer::Util::Evaluator

Inherits:
Object
  • Object
show all
Defined in:
lib/simmer/util/evaluator.rb

Overview

Glues together Objectable and Stringento libraries to form a text template renderer.

Instance Method Summary collapse

Constructor Details

#initialize(resolver = Resolver.new) ⇒ Evaluator

Returns a new instance of Evaluator.



16
17
18
19
20
# File 'lib/simmer/util/evaluator.rb', line 16

def initialize(resolver = Resolver.new)
  @resolver = resolver

  freeze
end

Instance Method Details

#evaluate(string, input = {}) ⇒ Object



22
23
24
# File 'lib/simmer/util/evaluator.rb', line 22

def evaluate(string, input = {})
  Stringento.evaluate(string, input, resolver: resolver)
end