Class: Factbase::Rules
- Inherits:
-
Object
- Object
- Factbase::Rules
- Defined in:
- lib/factbase/rules.rb
Overview
A decorator of a Factbase, that checks rules on every set.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Defined Under Namespace
Classes: Blind, Check, Fact, Query
Instance Method Summary collapse
- #dup ⇒ Object
- #export ⇒ Object
- #import(bytes) ⇒ Object
-
#initialize(fb, rules, check = Check.new(rules)) ⇒ Rules
constructor
A new instance of Rules.
- #insert ⇒ Object
- #query(query) ⇒ Object
- #size ⇒ Object
- #txn(this = self) ⇒ Object
Constructor Details
Instance Method Details
#dup ⇒ Object
37 38 39 |
# File 'lib/factbase/rules.rb', line 37 def dup Factbase::Rules.new(@fb.dup, @rules, @check) end |
#export ⇒ Object
63 64 65 |
# File 'lib/factbase/rules.rb', line 63 def export @fb.export end |
#import(bytes) ⇒ Object
67 68 69 |
# File 'lib/factbase/rules.rb', line 67 def import(bytes) @fb.import(bytes) end |
#insert ⇒ Object
45 46 47 |
# File 'lib/factbase/rules.rb', line 45 def insert Fact.new(@fb.insert, @check) end |
#query(query) ⇒ Object
49 50 51 |
# File 'lib/factbase/rules.rb', line 49 def query(query) Query.new(@fb.query(query), @check) end |
#size ⇒ Object
41 42 43 |
# File 'lib/factbase/rules.rb', line 41 def size @fb.size end |