Class: XRBP::NodeStore::DB
- Inherits:
-
Object
- Object
- XRBP::NodeStore::DB
- Includes:
- Enumerable, EventEmitter
- Defined in:
- lib/xrbp/nodestore/db.rb
Overview
Base NodeStore DB module, the client will use this class through specific DB-type subclass.
Subclasses should define the [ ] (index) method taking key to lookup, returning corresponding NodeStore value and each method, iterating over nodestore values (see existing subclasses for implementation details)
Direct Known Subclasses
Instance Method Summary collapse
-
#account(hash) ⇒ Object
Return the NodeStore Account for the given lookup hash.
-
#inner_node(hash) ⇒ Object
Return the NodeStore InnerNode for the given lookup hash.
-
#ledger(hash) ⇒ Object
Return the NodeStore Ledger for the given lookup hash.
-
#ledger_entry(hash) ⇒ Object
Return the NodeStore Ledger Entry for the given lookup hash.
-
#tx(hash) ⇒ Object
Return the NodeStore Transaction for the given lookup hash.
Instance Method Details
#account(hash) ⇒ Object
Return the NodeStore Account for the given lookup hash
35 36 37 |
# File 'lib/xrbp/nodestore/db.rb', line 35 def account(hash) ledger_entry(hash) end |
#inner_node(hash) ⇒ Object
Return the NodeStore InnerNode for the given lookup hash
54 55 56 57 58 |
# File 'lib/xrbp/nodestore/db.rb', line 54 def inner_node(hash) val = self[hash] return nil if val.nil? parse_inner_node(val) end |
#ledger(hash) ⇒ Object
Return the NodeStore Ledger for the given lookup hash
28 29 30 31 32 |
# File 'lib/xrbp/nodestore/db.rb', line 28 def ledger(hash) val = self[hash] return nil if val.nil? parse_ledger(val) end |
#ledger_entry(hash) ⇒ Object
Return the NodeStore Ledger Entry for the given lookup hash
40 41 42 43 44 |
# File 'lib/xrbp/nodestore/db.rb', line 40 def ledger_entry(hash) val = self[hash] return nil if val.nil? parse_ledger_entry(val) end |
#tx(hash) ⇒ Object
Return the NodeStore Transaction for the given lookup hash
47 48 49 50 51 |
# File 'lib/xrbp/nodestore/db.rb', line 47 def tx(hash) val = self[hash] return nil if val.nil? parse_tx(val) end |