Class: Factbase::Gt

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

Overview

Represents a greater-than comparison term in the Factbase. This class is used to evaluate whether a given fact satisfies the greater-than condition with the provided operands.

Instance Method Summary collapse

Methods included from TermShared

#to_s

Constructor Details

#initialize(operands) ⇒ Gt

Constructor.

Parameters:

  • operands (Array)

    Operands



15
16
17
18
# File 'lib/factbase/terms/gt.rb', line 15

def initialize(operands)
  super()
  @op = Factbase::Compare.new(:>, operands)
end

Instance Method Details

#evaluate(fact, maps, fb) ⇒ Boolean

Evaluate term on a fact.

Parameters:

Returns:

  • (Boolean)

    The result of the greater-than comparison



25
26
27
# File 'lib/factbase/terms/gt.rb', line 25

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