Class: Factbase::Concat
- Defined in:
- lib/factbase/terms/concat.rb
Overview
- License
-
MIT
Instance Method Summary collapse
-
#evaluate(fact, maps, fb) ⇒ String
Evaluate term on a fact.
-
#initialize(operands) ⇒ Concat
constructor
A new instance of Concat.
Methods included from TermShared
Constructor Details
#initialize(operands) ⇒ Concat
13 14 15 16 |
# File 'lib/factbase/terms/concat.rb', line 13 def initialize(operands) super() @operands = operands end |
Instance Method Details
#evaluate(fact, maps, fb) ⇒ String
Evaluate term on a fact.
23 24 25 |
# File 'lib/factbase/terms/concat.rb', line 23 def evaluate(fact, maps, fb) (0..(@operands.length - 1)).map { |i| _values(i, fact, maps, fb)&.first }.join end |