Class: Factbase::Times

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

Overview

It performs a multiplication operation over the given operands.

Instance Method Summary collapse

Methods included from TermShared

#to_s

Constructor Details

#initialize(operands) ⇒ Times

Constructor.

Parameters:

  • operands (Array)

    Operands



12
13
14
15
# File 'lib/factbase/terms/times.rb', line 12

def initialize(operands)
  super()
  @times = Factbase::Arithmetic.new(:*, operands)
end

Instance Method Details

#evaluate(fact, maps, fb) ⇒ Object

Evaluate term on a fact.

Parameters:

Returns:

  • (Object)

    Result of the multiplication



22
23
24
# File 'lib/factbase/terms/times.rb', line 22

def evaluate(fact, maps, fb)
  @times.evaluate(fact, maps, fb)
end