Module: VinaryTree::Liblevenshtein::Finalizer

Defined in:
lib/vinary_tree/liblevenshtein.rb

Class Method Summary collapse

Class Method Details

.for(box, function) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/vinary_tree/liblevenshtein.rb', line 38

def for(box, function)
  proc do
    pointer = box[0]
    function.call(pointer) unless pointer.nil? || pointer.zero?
    box[0] = 0
  rescue StandardError
    nil
  end
end