Class: Factbase::Minus

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

Overview

It performs a subtraction operation over the given operands.

Instance Method Summary collapse

Methods included from TermShared

#to_s

Constructor Details

#initialize(operands) ⇒ Minus

Constructor.

Parameters:

  • operands (Array)

    Operands



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

def initialize(operands)
  super()
  @minus = Factbase::Arithmetic.new(:-, operands)
end

Instance Method Details

#evaluate(fact, maps, fb) ⇒ Object

Evaluate term on a fact.

Parameters:

Returns:

  • (Object)

    Result of the subtraction



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

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