Class: Cel::Checker

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

Instance Method Summary collapse

Constructor Details

#initialize(declarations) ⇒ Checker

Returns a new instance of Checker.



5
6
7
# File 'lib/cel/checker.rb', line 5

def initialize(declarations)
  @declarations = declarations
end

Instance Method Details

#check(ast) ⇒ Object Also known as: call



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/cel/checker.rb', line 9

def check(ast)
  case ast
  when Group
    check(ast.value)
  when Invoke
    check_invoke(ast)
  when Operation
    check_operation(ast)
  when Literal
    ast.type
  when Identifier
    check_identifier(ast)
  when Condition
    check_condition(ast)
  end
end