Class: Factbase::Count
Overview
The ‘count’ term is used to perform a count operation on a set of maps.
Instance Method Summary collapse
-
#evaluate(_fact, maps, _fb) ⇒ Integer
Evaluate term on a fact.
-
#initialize(operands) ⇒ Count
constructor
Constructor.
Methods included from TermShared
Constructor Details
#initialize(operands) ⇒ Count
Constructor.
11 12 13 14 15 |
# File 'lib/factbase/terms/count.rb', line 11 def initialize(operands) super() @operands = operands @op = :count end |
Instance Method Details
#evaluate(_fact, maps, _fb) ⇒ Integer
Evaluate term on a fact.
22 23 24 |
# File 'lib/factbase/terms/count.rb', line 22 def evaluate(_fact, maps, _fb) maps.size end |