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.



147
148
149
150
# File 'lib/factbase/rules.rb', line 147

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

Instance Method Details

#include?(fact) ⇒ Boolean

Returns:

  • (Boolean)


158
159
160
161
162
163
# File 'lib/factbase/rules.rb', line 158

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

#it(fact) ⇒ Object



152
153
154
155
156
# File 'lib/factbase/rules.rb', line 152

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