Class: Factbase::Max
Overview
The ‘max’ term. This term calculates the max value among the evaluated operands.
Constant Summary collapse
Instance Method Summary collapse
-
#evaluate(_fact, maps, _fb) ⇒ Object
Evaluate term on a fact.
-
#initialize(operands) ⇒ Max
constructor
Constructor.
Methods included from TermShared
Constructor Details
#initialize(operands) ⇒ Max
Constructor.
17 18 19 20 21 |
# File 'lib/factbase/terms/max.rb', line 17 def initialize(operands) super() @operands = operands @op = :max end |
Instance Method Details
#evaluate(_fact, maps, _fb) ⇒ Object
Evaluate term on a fact.
28 29 30 31 |
# File 'lib/factbase/terms/max.rb', line 28 def evaluate(_fact, maps, _fb) assert_args(1) MAX.evaluate(@operands[0], maps) end |