Class: Factbase::Gte

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

Overview

It represents a term for evaluating whether a set of operands satisfies the “greater-than-or-equal-to” (>=) condition within the context of a factbase.

Instance Method Summary collapse

Methods included from TermShared

#to_s

Constructor Details

#initialize(operands) ⇒ Gte

Constructor.

Parameters:

  • operands (Array)

    Operands



14
15
16
17
# File 'lib/factbase/terms/gte.rb', line 14

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-or-equal comparison



24
25
26
# File 'lib/factbase/terms/gte.rb', line 24

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