Class: MemDB::Index::Any
- Inherits:
-
Object
- Object
- MemDB::Index::Any
- Includes:
- MemDB::Index
- Defined in:
- lib/mem_db/index/any.rb
Defined Under Namespace
Classes: Bucket
Instance Method Summary collapse
- #add(obj, value) ⇒ Object
- #bucket ⇒ Object
- #idx ⇒ Object
-
#initialize(original) ⇒ Any
constructor
A new instance of Any.
- #query(query, out: MemDB::Out.new) ⇒ Object
Methods included from MemDB::Index
Constructor Details
Instance Method Details
#add(obj, value) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/mem_db/index/any.rb', line 43 def add(obj, value) addr = obj.idx_value(idx) if addr == MemDB::Idx::ANY @any ||= bucket.new @any.add(obj, value) else @original.add(obj, value) end end |
#bucket ⇒ Object
39 40 41 |
# File 'lib/mem_db/index/any.rb', line 39 def bucket @original.bucket end |
#idx ⇒ Object
35 36 37 |
# File 'lib/mem_db/index/any.rb', line 35 def idx @original.idx end |