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