Class: Factbase::Rules::Later

Inherits:
Object
  • Object
show all
Defined in:
lib/factbase/rules.rb

Overview

Check one fact (never complaining).

This is an internal class, it is not supposed to be instantiated directly.

Instance Method Summary collapse

Constructor Details

#initialize(uid) ⇒ Later

Returns a new instance of Later.



127
128
129
130
# File 'lib/factbase/rules.rb', line 127

def initialize(uid)
  @uid = uid
  @facts = Set.new
end

Instance Method Details

#include?(fact) ⇒ Boolean

Returns:

  • (Boolean)


138
139
140
141
142
143
# File 'lib/factbase/rules.rb', line 138

def include?(fact)
  return true if @uid.nil?
  a = fact[@uid]
  return true if a.nil?
  @facts.include?(a[0])
end

#it(fact, _fb) ⇒ Object



132
133
134
135
136
# File 'lib/factbase/rules.rb', line 132

def it(fact, _fb)
  a = fact[@uid]
  return if a.nil?
  @facts << a[0] unless @uid.nil?
end