Class: Factbase::Never

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

Overview

The term ‘never’ that never evaluates to true.

Instance Method Summary collapse

Methods included from TermShared

#to_s

Constructor Details

#initialize(operands = []) ⇒ Never

Constructor.

Parameters:

  • operands (Array) (defaults to: [])

    Operands



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

def initialize(operands = [])
  super()
  @operands = operands
  @op = :never
end

Instance Method Details

#evaluate(_fact, _maps, _fb) ⇒ Boolean

Evaluate term on a fact.

Parameters:

Returns:

  • (Boolean)

    Always returns false



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

def evaluate(_fact, _maps, _fb)
  assert_args(0)
  false
end