Class: FEEL::SimpleUnaryTests
- Defined in:
- lib/feel/nodes.rb
Overview
-
simple unary tests =
14.a simple positive unary tests | 14.b “not”, “(”, simple positive unary tests, “)” | 14.c “-”;
Instance Method Summary collapse
Methods inherited from Node
#access_property, #qualified_names_in_context, #raise_evaluation_error
Instance Method Details
#eval(context = {}) ⇒ Object
231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/feel/nodes.rb', line 231 def eval(context = {}) if defined?(expr) && expr.present? tests = Array.wrap(expr.eval(context)) if defined?(negate) && negate.present? ->(input) { !tests.any? { |test| test.call(input) } } else ->(input) { tests.any? { |test| test.call(input) } } end else ->(_input) { true } end end |