From fe7dae730f070b6fe0e49d41179ff4d86008cca6 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 12 May 2008 13:24:38 +0000 Subject: [PATCH] * lib/date.rb (once): use Object#object_id instead of Symbol#to_i. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/date.rb | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83899ab662..7401c22101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon May 12 22:23:01 2008 Tanaka Akira + + * lib/date.rb (once): use Object#object_id instead of Symbol#to_i. + Mon May 12 21:34:46 2008 NAKAMURA Usaku * test/ruby/envutil.rb (rubybin): return expanded rubyexe instead of diff --git a/lib/date.rb b/lib/date.rb index 05b11d3176..d2fc8613b2 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -1104,10 +1104,10 @@ class Date def once(*ids) # :nodoc: -- restricted for id in ids module_eval <<-"end;" - alias_method :__#{id.to_i}__, :#{id.to_s} - private :__#{id.to_i}__ + alias_method :__#{id.object_id}__, :#{id.to_s} + private :__#{id.object_id}__ def #{id.to_s}(*args) - @__ca__[#{id.to_i}] ||= __#{id.to_i}__(*args) + @__ca__[#{id.object_id}] ||= __#{id.object_id}__(*args) end end; end