summaryrefslogtreecommitdiff
path: root/lib/final.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/final.rb')
-rw-r--r--lib/final.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/final.rb b/lib/final.rb
index 566d1aa..fc17dce 100644
--- a/lib/final.rb
+++ b/lib/final.rb
@@ -15,26 +15,26 @@
#
module ObjectSpace
- Finalizer = {}
+ Finalizers = {}
def define_finalizer(obj, proc=lambda())
ObjectSpace.call_finalizer(obj)
- if assoc = Finalizer[obj.id]
+ if assoc = Finalizers[obj.id]
assoc.push(proc)
else
- Finalizer[obj.id] = [proc]
+ Finalizers[obj.id] = [proc]
end
end
def undefine_finalizer(obj)
- Finalizer.delete(obj.id)
+ Finalizers.delete(obj.id)
end
- module_function :define_finalizer, :remove_finalizer
+ module_function :define_finalizer, :undefine_finalizer
Generic_Finalizer = proc {|id|
- if Finalizer.key? id
- for proc in Finalizer[id]
+ if Finalizers.key? id
+ for proc in Finalizers[id]
proc.call(id)
end
- Finalizer.delete(id)
+ Finalizers.delete(id)
end
}
add_finalizer Generic_Finalizer