Class: Factbase::Not
Overview
Logical negation (NOT) of an operand.
Instance Method Summary collapse
-
#evaluate(fact, maps, fb) ⇒ Boolean
Evaluate term on a fact.
-
#initialize(operands) ⇒ Not
constructor
Constructor.
Methods included from TermShared
Constructor Details
#initialize(operands) ⇒ Not
Constructor.
13 14 15 16 17 |
# File 'lib/factbase/terms/not.rb', line 13 def initialize(operands) super() @operands = operands @op = :not end |
Instance Method Details
#evaluate(fact, maps, fb) ⇒ Boolean
Evaluate term on a fact.
23 24 25 26 |
# File 'lib/factbase/terms/not.rb', line 23 def evaluate(fact, maps, fb) assert_args(1) !Factbase::Boolean.new(_values(0, fact, maps, fb), @operands[0]).bool? end |