Class: MemDB::Index::Enum
- Inherits:
-
Object
- Object
- MemDB::Index::Enum
- Includes:
- MemDB::Index
- Defined in:
- lib/mem_db/index/enum.rb
Defined Under Namespace
Classes: Bucket
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#idx ⇒ Object
readonly
Returns the value of attribute idx.
Instance Method Summary collapse
- #add(obj, value) ⇒ Object
-
#initialize(idx:, bucket: MemDB::Bucket) ⇒ Enum
constructor
A new instance of Enum.
- #query(query, out: MemDB::Out.new) ⇒ Object
Methods included from MemDB::Index
Constructor Details
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
26 27 28 |
# File 'lib/mem_db/index/enum.rb', line 26 def bucket @bucket end |
#idx ⇒ Object (readonly)
Returns the value of attribute idx.
26 27 28 |
# File 'lib/mem_db/index/enum.rb', line 26 def idx @idx end |
Instance Method Details
#add(obj, value) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/mem_db/index/enum.rb', line 34 def add(obj, value) enums = obj.idx_value(@idx) enums.each do |enum| b = @hash[enum] ||= @bucket.new b.add(obj, value) end end |