mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
e67e71d36a
commit
fe7dae730f
2 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue