Class: Factbase::One
Overview
The term which property has exactly one value.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024-2025 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
-
#evaluate(fact, maps, fb) ⇒ Boolean
Evaluate term on a fact.
-
#initialize(operands) ⇒ One
constructor
Constructor.
Methods included from TermShared
Constructor Details
#initialize(operands) ⇒ One
Constructor.
15 16 17 18 |
# File 'lib/factbase/terms/one.rb', line 15 def initialize(operands) super() @operands = operands end |
Instance Method Details
#evaluate(fact, maps, fb) ⇒ Boolean
Evaluate term on a fact.
25 26 27 28 29 |
# File 'lib/factbase/terms/one.rb', line 25 def evaluate(fact, maps, fb) assert_args(1) v = _values(0, fact, maps, fb) !v.nil? && v.size == 1 end |