Class: Factbase::Concat

Inherits:
TermBase show all
Defined in:
lib/factbase/terms/concat.rb

Overview

License

MIT

Instance Method Summary collapse

Methods included from TermShared

#to_s

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