summaryrefslogtreecommitdiff
path: root/lib/final.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-02 04:49:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-02 04:49:13 +0000
commitde0e5e35ae39a03879d8a954dd6b75654c173cd7 (patch)
tree6f936b0ed7666e5b4c7009c039775bed1a4e9f32 /lib/final.rb
parent3293a425afd07c4b004e06e14f1735ca841c1411 (diff)
__FILE__,__LINE__
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@62 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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