Class: Factbase::Rules::Later
- Inherits:
-
Object
- Object
- Factbase::Rules::Later
- 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
- #include?(fact) ⇒ Boolean
-
#initialize(uid) ⇒ Later
constructor
A new instance of Later.
- #it(fact) ⇒ Object
Constructor Details
#initialize(uid) ⇒ Later
Returns a new instance of Later.
139 140 141 142 |
# File 'lib/factbase/rules.rb', line 139 def initialize(uid) @uid = uid @facts = Set.new end |
Instance Method Details
#include?(fact) ⇒ Boolean
150 151 152 153 154 155 |
# File 'lib/factbase/rules.rb', line 150 def include?(fact) return true if @uid.nil? a = fact[@uid] return true if a.nil? @facts.include?(a[0]) end |
#it(fact) ⇒ Object
144 145 146 147 148 |
# File 'lib/factbase/rules.rb', line 144 def it(fact) a = fact[@uid] return if a.nil? @facts << a[0] unless @uid.nil? end |