Class: Cel::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/cel/environment.rb

Instance Method Summary collapse

Constructor Details

#initialize(declarations, ast) ⇒ Runner

Returns a new instance of Runner.



51
52
53
54
# File 'lib/cel/environment.rb', line 51

def initialize(declarations, ast)
  @declarations = declarations
  @ast = ast
end

Instance Method Details

#evaluate(bindings = nil) ⇒ Object



56
57
58
59
# File 'lib/cel/environment.rb', line 56

def evaluate(bindings = nil)
  context = Context.new(@declarations, bindings)
  Program.new(context).evaluate(@ast)
end