Class: VarOperator

Inherits:
Object
  • Object
show all
Includes:
BinaryOperator
Defined in:
lib/json_expr/operators/var_operator.rb

Instance Method Summary collapse

Methods included from BinaryOperator

#binary

Instance Method Details

#evaluate(evaluator, path) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/json_expr/operators/var_operator.rb', line 8

def evaluate(evaluator, path)
  if path.is_a?(Hash)
    path = to_sym(path)
    path = path[:path]
  end

  path.is_a?(String) ? evaluator.extract_var(path) : nil
end