summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-12 13:24:38 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-12 13:24:38 +0000
commitfe7dae730f070b6fe0e49d41179ff4d86008cca6 (patch)
treee84e0ddf8ce22e36d555f09eb9558fcb79c9f804
parente67e71d36ad07e53277225ccb768d61bf0569a16 (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--lib/date.rb6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 83899ab..7401c22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon May 12 22:23:01 2008 Tanaka Akira <akr@fsij.org>
+
+ * lib/date.rb (once): use Object#object_id instead of Symbol#to_i.
+
Mon May 12 21:34:46 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/envutil.rb (rubybin): return expanded rubyexe instead of
diff --git a/lib/date.rb b/lib/date.rb
index 05b11d3..d2fc861 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