Class: Critbit::DeleteCursor

Inherits:
Cursor
  • Object
show all
Defined in:
lib/critbit.rb

Instance Attribute Summary

Attributes inherited from Cursor

#key, #value

Instance Method Summary collapse

Constructor Details

#initialize(critbit, t_val = true, &block) ⇒ DeleteCursor





671
672
673
674
675
# File 'lib/critbit.rb', line 671

def initialize(critbit, t_val = true, &block)
  @critbit = critbit
  @t_val = t_val
  super(&block)
end

Instance Method Details

#select(entry) ⇒ Object





681
682
683
684
685
# File 'lib/critbit.rb', line 681

def select(entry)
  @critbit.delete(entry.getKey()) if (@block.call(entry.getKey(),
                                                  entry.getValue()) == @t_val)
  Decision::CONTINUE
end