Class: Factbase::Div

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

Overview

It performs a division operation over the given operands.

Instance Method Summary collapse

Methods included from TermShared

#to_s

Constructor Details

#initialize(operands) ⇒ Div

Constructor.

Parameters:

  • operands (Array)

    Operands



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

def initialize(operands)
  super()
  @div = Factbase::Arithmetic.new(:/, operands)
end

Instance Method Details

#evaluate(fact, maps, fb) ⇒ Object

Evaluate term on a fact.

Parameters:

Returns:

  • (Object)

    Result of the division



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

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