Class: Factbase::Looged
- Inherits:
-
Object
- Object
- Factbase::Looged
- Defined in:
- lib/factbase/looged.rb
Overview
A decorator of a Factbase, that logs all operations.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Defined Under Namespace
Instance Method Summary collapse
- #dup ⇒ Object
- #export ⇒ Object
- #import(bytes) ⇒ Object
-
#initialize(fb, loog) ⇒ Looged
constructor
A new instance of Looged.
- #insert ⇒ Object
- #query(query) ⇒ Object
- #size ⇒ Object
- #txn(this = self) ⇒ Object
Constructor Details
#initialize(fb, loog) ⇒ Looged
Returns a new instance of Looged.
30 31 32 33 |
# File 'lib/factbase/looged.rb', line 30 def initialize(fb, loog) @fb = fb @loog = loog end |
Instance Method Details
#dup ⇒ Object
35 36 37 |
# File 'lib/factbase/looged.rb', line 35 def dup Factbase::Looged.new(@fb.dup, @loog) end |
#export ⇒ Object
57 58 59 |
# File 'lib/factbase/looged.rb', line 57 def export @fb.export end |
#import(bytes) ⇒ Object
61 62 63 |
# File 'lib/factbase/looged.rb', line 61 def import(bytes) @fb.import(bytes) end |
#insert ⇒ Object
43 44 45 46 47 |
# File 'lib/factbase/looged.rb', line 43 def insert f = @fb.insert @loog.debug("Inserted new fact ##{@fb.size}") Fact.new(f, @loog) end |
#query(query) ⇒ Object
49 50 51 |
# File 'lib/factbase/looged.rb', line 49 def query(query) Query.new(@fb.query(query), query, @loog) end |
#size ⇒ Object
39 40 41 |
# File 'lib/factbase/looged.rb', line 39 def size @fb.size end |
#txn(this = self) ⇒ Object
53 54 55 |
# File 'lib/factbase/looged.rb', line 53 def txn(this = self, &) @fb.txn(this, &) end |